New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MCA : 'SparseDataFrame' object has no attribute 'to_numpy' #62
Comments
We could handle |
Just to clarify, my input dataframe https://github.com/MaxHalford/prince/blob/master/prince/one_hot.py |
Yep, got it. I'm on holiday at the moment, but I'll work on it when I get back in ~10 days. |
Can you please provide me with a fully working example? |
Ping @kaustubrao |
Hi Max, |
I created a reproducable example, if you find time to check it out:
|
Hey @DerpMind, |
Hi Max, it threw the same error for pandas version 0.25.3 |
No, sorry. You are right - I got it working now with an older version of pandas. |
I'm trying to execute the following code -
The problem is that OneHotEncoder has sparse set to True, so it returns a sparse dataframe. But the fit function has the following piece of code -
But to_numpy cannot be applied to sparse dataframes. As a result I'm getting the following error-
AttributeError: 'SparseDataFrame' object has no attribute 'to_numpy'
Not sure if this is a bug or if i'm doing something wrong.
The text was updated successfully, but these errors were encountered: