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: change dtype of Series from non-object to object inplace #3217

Closed
jreback opened this issue Mar 29, 2013 · 1 comment
Closed

BUG: change dtype of Series from non-object to object inplace #3217

jreback opened this issue Mar 29, 2013 · 1 comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Mar 29, 2013

see also #3216 , #3386

test in tests/test_series.py (test_update)

but cannot be fixed until Series is not longer a ndarray sub-class
as numpy cannot handle the float64 to object in-place dtype conversion
(which is why the sub-class issue comes up), if we have a single block
then can just swap out the block rather than attempting numpy magic here

In [18]: df = pd.DataFrame([{"a": 1}, {"a": 3, "b": 2}])
In [19]: df['c'] = np.nan
In [20]: df['c'].update(pd.Series(['foo'],index=[0]))
TypeError: Cannot change data-type for object array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

No branches or pull requests

1 participant