Closed
Description
I am getting different results when using the where method with inplace=False
vs inplace=True
.
consider the following dataframe
:
df = pd.DataFrame({'a':[1,None,3]})
df
a
0 1.0
1 Nan
2 3.0
when using the where method with inplace=False
(the default), i get the following result:
df.where(pd.notnull(df), None)
a
0 1.0
1 None
2 3.0
with a
being converted to be of type object
.
however if i do this:
df.where(pd.notnull(df), None, inplace=True)
df
a
0 1.0
1 Nan
2 3.0
a
is of type float64
pandas version: 0.23.3 , numpy version: 1.14.5
reported because of my question on SO