【发布时间】:2021-11-25 11:19:10
【问题描述】:
我有以下 spark 数据框。
Column_1
Physics=99;name=Xxxx;age=15
Physics=97;chemistry=85;name=yyyy;age=14
Physics=97;chemistry=85;maths=65;name=zzzz;age=14
我必须将上面的数据框列拆分为多个列,如下所示。
column_1 name age
Physics=99 Xxxx 15
Physics=97;chemistry=85 yyyy 14
Physics=97;chemistry=85;maths=65 zzzz 14
我尝试使用分隔符进行拆分;和限制。但它也将主题分成不同的列。姓名和年龄合并到一个列中。我要求将所有科目放在一列中,仅将姓名和年龄放在单独的列中。
是否有可能在 Pyspark 中实现这一点。
【问题讨论】:
-
作为数组还是字符串?
-
我需要它作为字符串
标签: apache-spark pyspark