-1

If I want to retrieve the Categories, then how can I access the value of the wrapped array of categories the tree is shown as in the image.

enter image description here

chinskiy
  • 2,557
  • 4
  • 21
  • 40
  • 1
    Please don't post images and consider adding a [reproducible example](https://stackoverflow.com/q/48427185/8371915). What output do you want? – Alper t. Turker Jan 26 '18 at 11:23

1 Answers1

2

Try this :

from pyspark.sql import functions as F
df.select(F.explode("categories")).show()

another way could be also to use getItems method applied to your column categories.

Steven
  • 14,048
  • 6
  • 38
  • 73