在spark.SQL DataFrame和pandas DataFrame之间转换

时间:2017-01-24 11:04:08

标签: apache-spark apache-spark-sql apache-zeppelin

这可能

转换自 至 pd.DataFrame

在%pyspark环境下?

1 个答案:

答案 0 :(得分:11)

尝试:

spark_df.toPandas()
  

toPandas()

Returns the contents of this DataFrame as Pandas pandas.DataFrame.

This is only available if Pandas is installed and available.

如果你想要对方:

spark_df = createDataFrame(pandas_df)