Let's say I have a df like this:
id type length key1 key2 key3
0 1 A 144 [value1,value2] value3
1 1 B 20 value4 [value5]
2 4 A 54 [value6]
Is there a way in PySpark I can get value5 and value6 out of the list since they are the only elements? I want to apply this to all cells. Output would be:
id type length key1 key2 key3
0 1 A 144 [value1,value2] value3
1 1 B 20 value4 value5
2 4 A 54 value6