简体   繁体   中英

'numpy.ndarray' object has no attribute 'DataFrame'

Actually, I want to drop the target column for that I have written

x=scaler_data.drop(['site_eui'],axis=1)

but I got an error:-'numpy.ndarray' object has no attribute 'drop'

for resolving this I have written

x = scaler_data.DataFrame(StandardScaler().fit_transform(df), columns=df.columns, index=df.index)

and now I am getting this error:-'numpy.ndarray' object has no attribute 'DataFrame'

would be helpful to see an example of your dataframe and which specific column you want to get rid of. .drop() mainly used with dataframe with 2 dimentional data (if you are using pandas) numpy has.delete() function to delete the data if you want to delete data from ndarray.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM