0
from pyspark.sql.functions import explode_outer
df1 = df.withColumn("col1",explode_outer(col1)).show()

my sample data

col1
usa,uk,mexico
india,japan

how to achieve expected column thru pyspark explode function

expected results

usa
uk
mexico
india
japan
James Z
  • 12,104
  • 10
  • 27
  • 43
sasopk
  • 9
  • 1
  • 1
    Does this answer your question? [Explode in PySpark](https://stackoverflow.com/questions/38210507/explode-in-pyspark) – werner Sep 20 '21 at 20:49

0 Answers0