My question is about purpose of have inplace= true in "df.dropna(subset = ["price"], axis = 0, inplace = true)"?
Asked
Active
Viewed 610 times
-3
-
1so that it does the operations in place. – SuperStew Jun 30 '20 at 15:32
-
1Does this answer your question? [Understanding inplace=True](https://stackoverflow.com/questions/43893457/understanding-inplace-true) – Sowjanya R Bhat Jun 30 '20 at 19:11
1 Answers
0
This is one of the 2 alternative code styles:
# 1
df.dropna(subset = ["price"], axis = 0, inplace = true)
# 2
df = df.dropna(subset = ["price"], axis = 0)
Choosing one is the matter of personal style, to me the latter one is more readable.

Poe Dator
- 4,535
- 2
- 14
- 35