Categories
Mastering Development

Convert a PySpark Dataframe Column to a Python List depending on the value in another column

I have a dataframe "dfClean" with 2 columns: +—+—–+ |som| ano | +—+—–+ | 1 | 1 | | 2 | 0 | | 3 | 1 | | 4 | 1 | I need to create a Python list with those values in "som" that have 1 in the column "ano" on the same […]