I have a python list say l=["abc is good", "xyz is bad"]
I already have a pyspark dataframe with columns 'A' and 'B' which are of string datatype as shown below
| A | B |
|---|---|
| One | Two |
Now I need new column C which can holds the list l
After changes the dataframe should look like this
| A | B | C |
|---|---|---|
| One | Two | ["abc is good", "xyz is bad"] |
sample code:
df=spark.createDataFrame([("one","two")],["A","B"])