jypter notebookでのエラーについてです
import statsmodels.api as sm
import numpy as np
from sklearn import linear_model, datasets
from sklearn.linear_model import LinearRegression
equation_df=pd.concat([age,overall,wage,potential], axis=1)
reputation = pd.DataFrame(equation_df.Reputation)
x_list = equation_df.drop("Reputation",1)
x_list = x_list.drop(x_list.columns[np.isnan(x_list).any()], axis=1)
#print(x_list)
model = sm.OLS(Reputation, sm.add_constant(x_list))
result =model.fit()
print(result.summary())
print(result.pvalues)
このように打ち込んだのですが、以下のように出てきてしまいました。
AttributeError Traceback (most recent call last)
<ipython-input-28-97c0a125e58e> in <module>
5
6 equation_df=pd.concat([age,overall,wage,potential], axis=1)
----> 7 reputation = pd.DataFrame(equation_df.Reputation)
8 x_list = equation_df.drop("Reputation",1)
9
~/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py in getattr(self, name)
5065 if self._info_axis._can_hold_identifiers_and_holds_name(name):
5066 return self[name]
-> 5067 return object.getattribute(self, name)
5068
5069 def setattr(self, name, value):
AttributeError: 'DataFrame' object has no attribute 'Reputation'
どうすれば解決できますでしょうか。