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

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

Comments

Projects
None yet
1 participant
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.

Contributor

jreback commented Aug 16, 2013

closed by #3482

jreback closed this Aug 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment