#DataframeMethod

In PySpark, fillna() replaces null values in a DataFrame with a specified value.

Syntax: -

df.fillna(value, subset=None)

Example: -

df.fillna(0).show()  # Replace all nulls with 0
df.fillna({"col1": 0, "col2": "N/A"}).show()  # Column-specific replacement