Skip to content
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

BUG: series with complex nan #53682

Merged
merged 5 commits into from
Jun 20, 2023
Merged

Conversation

Charlie-XIAO
Copy link
Contributor

@Charlie-XIAO Charlie-XIAO commented Jun 15, 2023

@Charlie-XIAO Charlie-XIAO marked this pull request as ready for review June 15, 2023 15:45
@Charlie-XIAO Charlie-XIAO requested a review from WillAyd as a code owner June 15, 2023 15:45
@Charlie-XIAO
Copy link
Contributor Author

Charlie-XIAO commented Jun 15, 2023

@jbrockmendel suggested changes made, thanks for your review!

One thing to notice is the repr:

>>> import pandas as pd
>>> pd.Series([complex("nan")])
0   NaN
dtype: complex128
>>> pd.Series([1, complex("nan"), 2])
0    1.0+0.0j
1   N000a000N
2    2.0+0.0j
dtype: complex128

I don't think this is as expected, but I suppose this should be a separate issue?

@mroeschke mroeschke added Complex Complex Numbers Constructors Series/DataFrame/Index/pd.array Constructors labels Jun 20, 2023
@mroeschke mroeschke added this to the 2.1 milestone Jun 20, 2023
@mroeschke mroeschke merged commit 89cb139 into pandas-dev:main Jun 20, 2023
@mroeschke
Copy link
Member

Thanks @Charlie-XIAO

I don't think this is as expected, but I suppose this should be a separate issue?

Yeah that appears to be a bug. Could you open a separate issue about that?

@Charlie-XIAO
Copy link
Contributor Author

Sure, will do soon.

canthonyscott pushed a commit to canthonyscott/pandas-anthony that referenced this pull request Jun 23, 2023
* avoid float(complex('nan'))

* update

* added test

* modified tests; added changelog

* changelog modified
@Charlie-XIAO Charlie-XIAO deleted the ser-complex-nan branch June 28, 2023 05:40
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
* avoid float(complex('nan'))

* update

* added test

* modified tests; added changelog

* changelog modified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complex Complex Numbers Constructors Series/DataFrame/Index/pd.array Constructors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pd.Series([complex('nan')]) raises
3 participants