相关疑难解决方法(0)

'DataFrame' 对象没有属性 'as_matrix

import pandas as pd

from sklearn.model_selection import train_test_split

import pandas as pd

from sklearn.model_selection import train_test_split

from sklearn import ensemble

from sklearn.metrics import mean_absolute_error

from joblib import *

df = pd.read_csv('~/Downloads/Melbourne_housing_FULL.csv')

df.head(n=5)
del df['Address']
del df['Method']
del df['SellerG']
del df['Date']
del df['Postcode']
del df['Lattitude']
del df['Longtitude']
del df['Regionname']
del df['Propertycount']
df.dropna(axis=0, how='any', thresh=None, subset=None, inplace=True)
features_df = pd.get_dummies(df, columns=['Suburb', 'CouncilArea', 'Type'])
X = features_df.as_matrix()
y = df['Price'].as_matrix()
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮助我我在输入 X = features_df.as_matrix() y = df['Price'].as_matrix() 时遇到错误,我正在用 Oliver 的名为 Machine Learning with …

python dataframe pandas

23
推荐指数
4
解决办法
3万
查看次数

标签 统计

dataframe ×1

pandas ×1

python ×1