Comments¶
DataFrame.replace
works different fromDataFrame.update
.
In [2]:
import pandas as pd
In [8]:
df = pd.DataFrame({"x": [1, 2, 3, 4, 5], "y": [5, 4, 3, 2, 1]})
df
Out[8]:
In [11]:
df.x[df.x < 3] = 1000
In [12]:
df
Out[12]:
In [6]:
df.y.replace(5, 5000, inplace=True)
In [7]:
df
Out[7]:
In [ ]: