-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
"Expected type 'str', got 'Series | Series' instead" Warning When Accessing DataFrame Cell in Pandas #856
Comments
Which type checker are you using? What you want to use here is |
I think that's a bug in the pycharm type checker. I tried your code with both You might also considering upgrading your version of |
I updated |
Yes. I'm going to close this as we are only supporting |
I am working with a Pandas DataFrame in Python and encountering an issue when trying to access a specific cell value. My goal is to retrieve the city name associated with a particular row in the DataFrame.
Minimal Reproducible Example:
When I run this code, I receive the following warning:
Expected type 'str', got 'Series | Series' instead
I don't think the type-hinting is wrong.
selected_cell: str = df.loc[1, "City"]
does not work either.I'm running on
Python 3.11.1
andpandas 2.1.0
andpandas-stubs 2.0.0.230412
. The type-checker isPyCharm 2023.3.2 (Professional Edition)
.The text was updated successfully, but these errors were encountered: