Skip to content

Power to the NA with Int64 series gives NA #22022

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

Closed
jorisvandenbossche opened this issue Jul 23, 2018 · 1 comment · Fixed by #23155
Closed

Power to the NA with Int64 series gives NA #22022

jorisvandenbossche opened this issue Jul 23, 2018 · 1 comment · Fixed by #23155
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays.
Milestone

Comments

@jorisvandenbossche
Copy link
Member

Corner-case, but the integer NA type does seem to behave differently when it comes to rpow:

In [57]: pd.Series([1, 1, 1]) ** pd.Series([1, np.nan, 3])
Out[57]: 
0    1.0
1    1.0
2    1.0
dtype: float64

In [58]: pd.Series([1, 1, 1]) ** pd.Series([1, np.nan, 3], dtype='Int64')
Out[58]: 
0      1
1    NaN
2      1
dtype: Int64

In [63]: 1 ** np.nan
Out[63]: 1.0

@jorisvandenbossche jorisvandenbossche added Bug ExtensionArray Extending pandas with custom dtypes or arrays. labels Jul 23, 2018
@jorisvandenbossche jorisvandenbossche added this to the 0.24.0 milestone Jul 23, 2018
@TomAugspurger
Copy link
Contributor

Closely related, object gets this wrong too.

In [6]: s = pd.Series([1, None], dtype=object)

In [7]: 1 ** s
Out[7]:
0      1
1    NaN
dtype: object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants