Skip to content

BUG: IntegerArray cannot cast from int to uint #22440

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 Aug 21, 2018 · 0 comments
Closed

BUG: IntegerArray cannot cast from int to uint #22440

jorisvandenbossche opened this issue Aug 21, 2018 · 0 comments
Labels
Bug ExtensionArray Extending pandas with custom dtypes or arrays.
Milestone

Comments

@jorisvandenbossche
Copy link
Member

In [25]: s = pd.Series([1, 2, 3, 4], dtype='Int64')

In [26]: s
Out[26]: 
0    1
1    2
2    3
3    4
dtype: Int64

In [27]: s.astype('UInt32')
...
TypeError: Cannot cast array from dtype('int64') to dtype('uint32') according to the rule 'same_kind'

with numpy dtypes this works:

In [30]: s = pd.Series([1, 2, 3, 4], dtype='int64')

In [31]: s.astype('uint32')
Out[31]: 
0    1
1    2
2    3
3    4
dtype: uint32
@jorisvandenbossche jorisvandenbossche added Bug ExtensionArray Extending pandas with custom dtypes or arrays. labels Aug 21, 2018
@jorisvandenbossche jorisvandenbossche added this to the 0.24.0 milestone Aug 21, 2018
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

No branches or pull requests

1 participant