Question

In Python, which method in the Pandas library would you use to replace NaN values in a DataFrame with the median value of each column?

A df.fillna(df.mean())
B df.replace(df.median())
C df.fillna(df.median())
D df.dropna(inplace=True)
E df.interpolate(method="median")
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)