-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
Needs TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressionsgood first issueinplaceRelating to inplace parameter or equivalentRelating to inplace parameter or equivalent
Milestone
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.0with 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.0a is of type float64
pandas version: 0.23.3 , numpy version: 1.14.5
reported because of my question on SO
Metadata
Metadata
Assignees
Labels
Needs TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressionsgood first issueinplaceRelating to inplace parameter or equivalentRelating to inplace parameter or equivalent