-
Notifications
You must be signed in to change notification settings - Fork 653
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
Value error when trying to access a series having dtype: string and some elements set to None #3981
Comments
@susmitpy Thanks for reporting this issue. I can reproduce it on my computer. The root cause appears to be a bug in pandas. When I run your example, I found that it comes from this line, where we try to use import pandas as pd
s = pd.DataFrame([["A"], ["B"], ["C"]], dtype="string")
s.iloc[[0, 1], :] = [None, None] On the latest pandas source code (version 1.5.0.dev0+122.gb4e578db85) I get a Stack trace
On the latest pandas release candidate (version 1.4.0rc0) I get a Stack trace
On the version of pandas that Modin is using (version 1.3.5) I get a Stack trace
@modin-project/modin-core I have filed pandas-dev/pandas#45469 for the pandas bug. Meanwhile, should we create a fix that works around the pandas bug? |
I'm working on this now. Just to further clarify, the bug seems to only apply to dtype import modin.pandas as pd
df = pd.DataFrame([["A", "B"], ["C", "D"]], dtype="string")
df.iloc[0, 0] = None But it also gets triggered by import modin.pandas as pd
df = pd.DataFrame([["A", "B"], ["C", "D"]], dtype="string")
df.iloc[[0, 1], [0, 1]] = None and the bug applies to and the corresponding |
…lars to set items. Signed-off-by: mvashishtha <mahesh@ponder.io>
System information
modin.__version__
): 0.12.0Describe the problem
Source code / logs
If nulls are already present and the type is changed it works without any issues
Workaround:
Convert dtype to
object
before setting values to NoneThe text was updated successfully, but these errors were encountered: