.fillna(method = 'pad') replaces the missing value by _________ .
.fillna(method = 'pad') replaces the missing value by _________ .
Solution
✅ Correct Option: 1
In pandas, fillna(method='pad') is a forward fill. Each missing value (NaN) is replaced by the last valid value that appears before it in the column or row. It is the same as ffill.
For example, [5, NaN, NaN, 8] becomes [5, 5, 5, 8].
Option 2: this is method='bfill' (or 'backfill'), which fills from the next valid value.
Option 4: this is fillna(value), for example fillna(0), where a fixed value is passed.
Related questions:
2025: 15 May Shift 2
2025: 15 May Shift 2
2026: 18 May Shift 2
2026: 29 May Shift 1
2026: 24 May Shift 1