Spyder: ndarray object of numpy module error - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Homework (https://python-forum.io/forum-9.html) +--- Thread: Spyder: ndarray object of numpy module error (/thread-7483.html) |
Spyder: ndarray object of numpy module error - python_newbie09 - Jan-12-2018 Hi all, I am going through the ML A-Z course on udemy to help me solve an assignment and I am at the stage of preprocessing my data at the moment. My code is as below: import numpy as np import pandas as pd import matplotlib.pyplot as plt dataset = pd.read_csv('Data.csv') X = dataset.iloc[:,:-1].values y = dataset.iloc[:,3].valuesWhen I run the lines, my variable window can't seem to display the values of the X and y array and instead shows ndarray object of numpy module. When I double click on X or y, an error dialog pops up saying object arrays are currently not supported. What do I need to do to solve this problem? Is it okay to ignore it and continue coding? I have already upgraded Spyder to the latest version as well but the problem remains. Thank you. RE: Spyder: ndarray object of numpy module error - python_newbie09 - Jan-12-2018 i was able to solve this issue on my own. it is a known problem while using Spyder but it's not an issue that will affect the code so I have ignored the error RE: Spyder: ndarray object of numpy module error - joro - Dec-19-2018 (Jan-12-2018, 06:57 PM)python_newbie09 Wrote: i was able to solve this issue on my own. it is a known problem while using Spyder but it's not an issue that will affect the code so I have ignored the errorHow did you solve it? I have the same problem, my y-axes cant be loaded. RE: Spyder: ndarray object of numpy module error - dhairya16 - Feb-05-2019 How did you solve the error ? RE: Spyder: ndarray object of numpy module error - MrWolf - Mar-17-2019 Just got this from Udemy... Most probably you version of Spyder cannot support the viewing of a numpy array with more than 1 type of elements. You will need to print this variable into the console to view it's contents. So just: print(X) and it's there. RE: Spyder: ndarray object of numpy module error - python_newbie09 - Mar-20-2019 (Dec-19-2018, 09:59 AM)joro Wrote:(Jan-12-2018, 06:57 PM)python_newbie09 Wrote: i was able to solve this issue on my own. it is a known problem while using Spyder but it's not an issue that will affect the code so I have ignored the errorHow did you solve it? I have the same problem, my y-axes cant be loaded. Sorry I was not here for a while. I hope you found the solution. It had something to do with the Spyder version if I remember correctly RE: Spyder: ndarray object of numpy module error - rohit_w - Jul-31-2019 dataset = pd.read_csv('50_Startups.csv') X = dataset.iloc[:, :-1] Y = dataset.iloc[:, 4] => Remove .values and it will work => But this will just create a dataframe of those datasets and not objects so choose wisely |