I want to find the max value in a list. How do you do this in pyspark?
df = spark.createDataFrame([(1, [4,1]), (2, [4,5]), (3, [4,0])], ["A", "B"])
df.show()
+---+------+
| A| B|
+---+------+
| 1|[4, 1]|
| 2|[4, 5]|
| 3|[4, 0]|
+---+------+
In this following example, how do I find on each row the max value from the list in column B. So for:
- row 1 --> 4
- row 2 --> 5
- row 3 --> 4