Closed
Description
I looked through all the open issues with update and dtype in them, but didn't find something - apologies if an issue exists already.
Consider:
>>> import pandas as pd
>>> s = pd.Series([10, 11, 12])
>>> t = pd.Series([61, 63], index=[1, 3])
>>> s.update(t)
>>> s
0 10
1 61
2 12
dtype: int64
So far, so good. Now, for frames:
>>> df = s.to_frame('A')
>>> df.update(t.to_frame('A'))
>>> df
A
0 10.0
1 61.0
2 12.0
Obviously, the dtype promotion here was neither desired nor necessary (strictly speaking; s
and t
are both int64
), and is simply a by-product of the alignment happening behind the scenes.