title: Pyspark: Converting a sample to Pandas Dataframe
body: <p>I trying to extract a sample from a dataframe (<code>df_spark</code>) with 100 million rows and converting it to a pandas dataframe using the below code:</p>
  <pre><code>df = df_spark.sample(withReplacement = False, fraction = 0.05, seed = 11).collect().toPandas()
  </code></pre>
  <p>Unfortunately, I'm getting the following error:</p>
  <pre><code>AttributeError: 'list' object has no attribute 'toPandas'
  </code></pre>
  <p>I also tried to convert it to rdd and then to pandas and got the same error.</p>
  <p>I'm wondering to know once I have the sample list what is the correct method to convert it to a pandas dataframe or a spark dataframe?</p>