Skater icon indicating copy to clipboard operation
Skater copied to clipboard

ValueError: Can't get rows for data of type <class 'pandas.core.series.Series'>

Open amaa11 opened this issue 4 years ago • 1 comments

Dear all,

I am using DecisionTreeClassifier and skater. When I apply skater, I got the error below. ValueError: Can't get rows for data of type <class 'pandas.core.series.Series'> I checked both x_train and x_test are pandas.core.frame.DataFrame while y_train and y_test are numpy.ndarray. I do not know where is the problem.. Any help please? Thanks in advance.

amaa11 avatar Jan 13 '21 22:01 amaa11

Dear all,

I am using DecisionTreeClassifier and skater. When I apply skater, I got the error below. ValueError: Can't get rows for data of type <class 'pandas.core.series.Series'> I checked both x_train and x_test are pandas.core.frame.DataFrame while y_train and y_test are numpy.ndarray. I do not know where is the problem.. Any help please? Thanks in advance.

The same as you. I've tried with a simple DNN built thorugh TensorFlow and with a simple scikit-learn model. Env: Python 3.7

I've encountered this error when I'm trying to plot the feature importance.

[EDIT] I solved my problem by using .values when passing Pandas DataFrame(s) as parameters. Try to pass NumPy array instead of Pandas DataFrame(s) by using .values

TheEdoardo93 avatar Feb 09 '21 22:02 TheEdoardo93