1

Here is my dataframe:

my_df.show()

+----------+
|  features|
+----------+
| [0,'a']  |
| [1,'b']  |
| [0,'c']  |
| [1,'d']  |
| [2,'e']  |
| [0,'f']  |
+----------+

how to convert it into a dataframe of tuples (with single column 'features')?

zero323
  • 322,348
  • 103
  • 959
  • 935
PeterLai
  • 105
  • 1
  • 9

1 Answers1

0

Try

my_df.map(lambda x: (x[0],x[1]))