how to NOT read_csv if csv is empty : <p>Using Python 2.7 and Pandas</p>

<p>I have to parse through my directory and plot a bunch of CSVs. If the CSV is empty, the script breaks and produces the error message: </p>

<pre><code>pandas.io.common.EmptyDataError: No columns to parse from file
</code></pre>

<p>If I have my file paths stored in </p>

<pre><code>file_paths=[]
</code></pre>

<p>how do I read through each one and only plot the non empty CSVs? If I have an empty dataframe defined as df=[] I attempt the following code</p>

<pre><code>for i in range(0,len(file_paths)):
   if pd.read_csv(file_paths[i] == ""):
      print "empty"
   else df.append(pd.read_csv(file_paths[i],header=None))
</code></pre>
