I am trying to replace the null values with N/A. I have tried with following code but none of them works:
df.withColumn("series_name", when($"series_name") === null,"n/a")
.otherwise($series_name)
and
df.withColumn("series_name", when(col("series_name") === null,"n/a")
what am I missing?
+--------------------+
| series_name|
+--------------------+
|Families of the M...|
| null|
| Ridiculousness|
| null|
| null|
+--------------------+