Skip to content
Advertisement

Tag: apache-spark

Filter expected value from list in df column

I have a data frame with the following column: I want to return a column with single value based on a conditional statement. I wrote the following function: When running the function on the column df.withColumn(“col”, filter_func(“raw_col”)) I have the following error col should be Column What’s wrong here? What should I do? Answer You can use array_contains function: But

Spread List of Lists to Sparks DF with PySpark?

I’m currently struggling with following issue: Let’s take following List of Lists: How can I create following Sparks DF out of it with one row per element of each sublist: The only way I’m getting this done is by processing this list to another list with for-loops, which basically then already represents all rows of my DF, which is probably

Advertisement