How to convert pyspark Dataframe to pandas Dataframe?

+1 vote

Hi Guys,

I am trying to create one Machine Learning model using pyspark. I want to convert my pyspark dataframe to pandas dataframe for some operation. How can I do that?

May 7 in Apache Spark by akhtar
• 25,050 points
2,475 views

1 answer to this question.

0 votes

Hi@akhtar,

To convert pyspark dataframe into pandas dataframe, you have to use this below given command.

$ pandas_df = spark_df.select("*").toPandas()

Hope this will help you.

answered May 7 by MD
• 56,520 points

Related Questions In Apache Spark

0 votes
1 answer

How to convert rdd object to dataframe in spark

SqlContext has a number of createDataFrame methods ...READ MORE

answered May 30, 2018 in Apache Spark by nitinrawat895
• 10,950 points
2,536 views
+1 vote
2 answers

How can I convert Spark Dataframe to Spark RDD?

Assuming your RDD[row] is called rdd, you ...READ MORE

answered Jul 9, 2018 in Apache Spark by zombie
• 3,750 points
8,490 views
+1 vote
1 answer
0 votes
3 answers

How to transpose Spark DataFrame?

Please check the below mentioned links for ...READ MORE

answered Dec 31, 2018 in Apache Spark by anonymous
12,794 views
+1 vote
2 answers
0 votes
1 answer

How to find the number of null contain in dataframe?

Hey there! You can use the select method of the ...READ MORE

answered May 3, 2019 in Apache Spark by Omkar
• 69,030 points
730 views
+2 votes
4 answers

use length function in substring in spark

You can use the function expr val data ...READ MORE

answered May 3, 2018 in Apache Spark by kurt_cobain
• 9,320 points
28,964 views
0 votes
3 answers

How to connect Spark to a remote Hive server?

JDBC is not required here. Create a hive ...READ MORE

answered Mar 8, 2019 in Big Data Hadoop by Vijay Dixon
• 190 points
3,751 views
0 votes
1 answer

How to parse a textFile to csv in pyspark?

Hi, Use this below given code, it will ...READ MORE

answered Apr 13 in Apache Spark by MD
• 56,520 points
365 views