我的问题是如何将列拆分为多列.我不知道为什么df.toPandas()不起作用.
例如,我想将'df_test'更改为'df_test2'.我看到很多使用pandas模块的例子.还有另外一种方法吗?先感谢您.
df_test = sqlContext.createDataFrame([
(1, '14-Jul-15'),
(2, '14-Jun-15'),
(3, '11-Oct-15'),
], ('id', 'date'))
Run Code Online (Sandbox Code Playgroud)
df_test2
id day month year
1 14 Jul 15
2 14 Jun 15
1 11 Oct 15
Run Code Online (Sandbox Code Playgroud)