title: How can I define an empty dataframe in Pyspark and append the corresponding dataframes with it?
body: <p>So I want to read the csv files from a directory, as a pyspark dataframe and then append them into single dataframe. 
  Not getting the alternative for this in pyspark, the way we do in pandas.</p>
  
  <p>For example in Pandas, we do: </p>
  
  <pre><code>files=glob.glob(path +'*.csv')
  
  df=pd.DataFrame() 
  
  for f in files:
      dff=pd.read_csv(f,delimiter=',')
      df.append(dff)
  </code></pre>
  
  <p>In Pyspark I have tried this but not successful</p>
  
  <pre><code>schema=StructType([])
  union_df = sqlContext.createDataFrame(sc.emptyRDD(),schema)
  
  for f in files:
      dff = sqlContext.read.load(f,format='com.databricks.spark.csv',header='true',inferSchema='true',delimiter=',')
      df=df.union_All(dff)
  </code></pre>
  
  <p>Would really appreciate any help. </p>
  
  <p>Thanks</p>