import matplotlib.pyplot as plt
from sklearn.datasets import load_boston
%matplotlib inline
boston = load_boston()
print(boston.keys())
When I type this I get the output:
dict_keys(['data', 'target', 'feature_names', 'DESCR', 'filename'])
so I know that feature_names is an attribute. However, when I type
boston.columns = boston.feature_names
the ouput comes as
'DataFrame' object has no attribute 'feature_names'
boston['feature_names']df = pd.DataFrame(boston.data,columns=boston.feature_names)boston.columns.valuesto see an array of your column namesAttributeError: 'DataFrame' object has no attribute 'data'