I am looking to make a list of columns all null. These columns might or might not have values within them. Ideally I am trying to wipe the columns clean of data.
This is what I currently have tried:
null_cols = ['a', 'b', 'c']
for cols in null_cols:
df = (
df.withColumn(cols, F.when(F.col(cols).isNotNull(), F.lit(None)))
)
Any ideas?