You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that, ironically, mca has some problems with handling a categorical index. I have such an index in my DataFrame which is created using pd.qcut(). When I run mca on this data I get an error:
I can work around this problem by using pd.to_numeric() on the offending column and then everything works. A minimal example that does not exactly yield the same error, but still does have a problem with the categorical index:
Thanks for reporting! I can reproduce the problem and am open to suggestions about how to solve it. It seems to be caused by a categorical first column, so checking for that and casting it to numeric should solve the problem. For example, these similar dataframes with re-assigned or re-ordered categorical columns don't have the same problem:
It seems that, ironically,
mca
has some problems with handling a categorical index. I have such an index in myDataFrame
which is created usingpd.qcut()
. When I runmca
on this data I get an error:I can work around this problem by using
pd.to_numeric()
on the offending column and then everything works. A minimal example that does not exactly yield the same error, but still does have a problem with the categorical index:Running the above code yields the following error:
Uncommenting the commented line fixes the problem. Hope this helps :-)
Cheers,
Omri
The text was updated successfully, but these errors were encountered: