title: Pyspark to read csv
body: <p>New to pyspark and would like to read csv file to dataframe. cant seem to have it read. Any help?</p>
  
  <pre><code>from pyspark.sql import SQLContext
  import pyspark
  from pyspark.sql import Row
  import csv
  
  
  sql_c = SQLContext(sc)
  
  rdd = sc.textFile('data.csv').map(lambda line: line.split(","))
  
  rdd.count()
  </code></pre>
  
  <p>Py4JJavaError                             Traceback (most recent call last)
   in ()
  ----> 1 rdd.count()</p>