Inspired by the How to replace NaNs by preceding or next values in pandas DataFrame?
Is there a way to replace every None, empty or null value with the first non-empty value in the same column above it? If you have a dataframe like:
0 1 2
0 1 2 3
1 4 None None
2 None None 9
to become like:
0 1 2
0 1 2 3
1 4 2 3
2 4 2 9
Spark has pyspark.sql.DataFrame.fillna but option like (method='ffill') is not available.