During the handling of missing values, in which function we use 'inplace = True' parameter in pandas to make changes in original DataFrame?
During the handling of missing values, in which function we use 'inplace = True' parameter in pandas to make changes in original DataFrame?
Solution
dropna() removes rows or columns containing missing values (NaN). By default it returns a new DataFrame and leaves the original unchanged. Writing df.dropna(inplace=True) makes the change in the original DataFrame and returns None.
Options 1 and 2: dropall() and fillall() are not pandas functions; the real ones are dropna() and fillna().
Option 4: isnull() only returns a True/False DataFrame showing where values are missing. It does not change data and has no inplace parameter.
fillna() also accepts inplace=True, but it is not among the options.
Related questions:
2025: 21 May Shift 1
2025: 22 May Shift 1
2025: 15 May Shift 2