Open zulee1711 opened 1 year ago
@zulee1711 thanks for the contribution!
At the moment, Pandas objects are specifically not accepted by Modin. For this code to work, you need to explicitly convert Pandas' dataframe to Modin's dataframe like that:
mpd.pivot_table(mpd.DataFrame(df), index = df.index, columns = ['ticker'])
@modin-project/modin-core there are more and more situations where it would be convenient for users to pass pandas objects to Modin functions. We should rethink this.
there are more and more situations where it would be convenient for users to pass pandas objects to Modin functions. We should rethink this.
I think what we should do is to make a more describable error message in these situations, something like: "you're trying to pass pandas object to a modin's method, please make the conversion as follows...".
It could be a real pain to efficiently support both pandas and modin objects, so my vote here is only to make clear errors.
I think what we should do is to make a more describable error message in these situations, something like: "you're trying to pass pandas object to a modin's method, please make the conversion as follows...".
+1
It could be a real pain to efficiently support both pandas and modin objects, so my vote here is only to make clear errors.
We don't have to make the case with pandas dataframes fast (just give a warning that dataframe conversion takes time and if you want performance boost, you need to rewrite the code). Here it is more important to ensure seamless integration with other libraries, where the user does not have the ability to change imports.
@anmyachev Thank you
I think what we should do is to make a more describable error message in these situations, something like: "you're trying to pass pandas object to a modin's method, please make the conversion as follows...".
A more detailed message is much appreciated. Since the error gave a warning in <class 'pandas.core.frame.DataFrame'>, I would know that there's something wrong with the code related to pandas dataframe, but wouldn't necessarily know where to look for an answer
UPD: Even using Modin objects, I see the following error on latest master.
TypeError: '<' not supported between instances of 'str' and 'Timestamp'
Modin version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest released version of Modin.
[X] I have confirmed this bug exists on the main branch of Modin. (In order to do this you can follow this guide.)
Reproducible Example
Issue Description
When using pivot tables with modin, appear ValueError: can not create pivot table with instance of type <class 'pandas.core.frame.DataFrame'> The regular Pandas works fine. Can anyone help me please?
Expected Behavior
df1 = pd.pivot_table(df, index = df.index, columns = ['ticker'])
Error Logs
Installed Versions