The method name is all lowercase: tolist.
So you need to change the offending line to:
x.append(df.values.tolist())
Answer from MSeifert on Stack OverflowIt would be helpful if you could post the full stack trace, so that we can see which line your error occurs at. In general, the more information you can provide in a question, the better.
In this case, it looks like your full_model_pipeline may somehow become a numpy array. Since you have a one-element pipeline, you could try changing
full_model_pipeline = Pipeline(steps =[
('full_pipeline',full_pipeline),
('model',LinearRegression())
])
full_model_pipeline.fit(X_train,y_train)
to
model = LinearRegression()
model.fit(X_train, y_train)
I believe you need to add () where you add scaler to the pipeline: ('std_scaler',StandardScaler) --> ('std_scaler',StandardScaler())
If you check the source code, you will see that right after tolist() code there is line to_list = tolist, so to_list is just alias for tolist
EDIT: to_list() was added in ver. 0.24.0, see issue#8826
Expanding on buran's answer (too much text to fit into a comment):
Using git blameon the pointed-out source code, one can see that to_list() was indeed added in December 2018 as an alias to tolist(). It was commited as an enhancement to resolve issue 8826, i.e., to make it more inline with to_period() and to_timestamp().
Moreover, changes and comments in pandas/core/series.py show that the original tolist() is "semi-deprecated":
# tolist is not actually deprecated, just suppressed in the __dir__
_deprecations = generic.NDFrame._deprecations | frozenset(
['asobject', 'reshape', 'get_value', 'set_value',
'from_csv', 'valid'])
'from_csv', 'valid', 'tolist'])
Interesting to see how the system works...