大数据的数据整形

2024-05-13 03:50:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我想重塑我的np数组并将其呈现为DF。我的初始数据集是2930行。我的标题/列包含以下(80)个元素:

Order;PID;MS SubClass;MS Zoning;Lot Frontage;Lot Area;Street;Alley;Lot Shape;Land Contour;Utilities;Lot Config;Land Slope;Neighborhood;Condition 1;Condition 2;Bldg Type;House Style;Overall Qual;Overall Cond;Year Built;Year Remod/Add;Roof Style;Roof Matl;Exterior 1st;Exterior 2nd;Mas Vnr Type;Mas Vnr Area;Exter Qual;Exter Cond;Foundation;Bsmt Qual;Bsmt Cond;Bsmt Exposure;BsmtFin Type 1;BsmtFin SF 1;BsmtFin Type 2;BsmtFin SF 2;Bsmt Unf SF;Total Bsmt SF;Heating;Heating QC;Central Air;Electrical;1st Flr SF;2nd Flr SF;Low Qual Fin SF;Gr Liv Area;Bsmt Full Bath;Bsmt Half Bath;Full Bath;Half Bath;Bedroom AbvGr;Kitchen AbvGr;Kitchen Qual;TotRms AbvGrd;Functional;Fireplaces;Fireplace Qu;Garage Type;Garage Yr Blt;Garage Finish;Garage Cars;Garage Area;Garage Qual;Garage Cond;Paved Drive;Wood Deck SF;Open Porch SF;Enclosed Porch;3Ssn Porch;Screen Porch;Pool Area;Pool QC;Fence;Misc Feature;Misc Val;Mo Sold;Yr Sold;Sale Type;Sale Condition;SalePrice

我尝试了以下代码:

^{pr2}$

结果==>

ValueError: cannot reshape array of size 2930 into shape (2930,15,newaxis)

为什么这不可能?将get数据集放入数据帧的可能解决方案?谢谢,非常感谢。在


Tags: 数据typeareasfconditionmslotland