Spyder Python "object arrays are currently not supported"

A good example is here

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
dataset = pd.read_csv('Salary_Data.csv') #in your case right name of your file
X=dataset.iloc[:,:-1].values   #this will convert dataframe to object
df = pd.DataFrame(X)

You can view data in dataframe this converts arrray to dataframe .

And the variable explorer accepts the dataframe. The above is correct and checked code


Solution: Downgrade the version of spyder to 3.2.0

You can do this by going to anaconda-navigator.

If you are following the Udemy Course on Machine Learning, probably the instructor is using an older version of spyder and it is working for him. In the newer versions like 3.2.8, it is not working but can be incorporated in the coming versions in the future.

Edit: This answer is not applicable now, since from the others answers we can see that this functionality has been added in >= 4 version of spyder.


I used the same without dataFrame and .values.
It worked for me.

x = dataset.iloc[:, :-1]
y = dataset.iloc[:,3]

(Spyder developer here) Support for object arrays will be added in Spyder 4, to be released in 2019.