This question already has an answer here:
- Requirements for converting Spark dataframe to Pandas/R dataframe 1 answer
Is that possible to
convert from to pd.DataFrame
under %pyspark environment ?
This question already has an answer here:
Is that possible to
convert from to pd.DataFrame
under %pyspark environment ?
Try:
spark_df.toPandas()
toPandas()
Returns the contents of this DataFrame as Pandas pandas.DataFrame. This is only available if Pandas is installed and available.
And if you want the oposite:
spark_df = createDataFrame(pandas_df)