close

[Solved] ‘DataFrame’ object has no attribute ‘as_matrix

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error ‘DataFrame’ object has no attribute ‘as_matrix’DataFrame’ object has no attribute ‘as_matrix in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How ‘DataFrame’ object has no attribute ‘as_matrix Error Occurs?

Today I get the following error ‘DataFrame’ object has no attribute ‘as_matrix’DataFrame’ object has no attribute ‘as_matrix in Python.

How To Solve ‘DataFrame’ object has no attribute ‘as_matrix Error ?

  1. How To Solve 'DataFrame' object has no attribute 'as_matrix Error ?

    To Solve 'DataFrame' object has no attribute 'as_matrix Error df.as_matrix() was deprecated after version 0.23.0. Use df.values instead. Follow this link for additional information.

Solution 1


df.as_matrix()
 was deprecated after version 0.23.0. Use df.values instead.

Follow this link for additional information.

Solution 2

Dataframe depricated a lot of attributes such as .ix

Here you need this command:

y = df['Price'].values

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment