title: How to record bad lines skipped by pandas
body: <p>I'm reading a CSV file with pandas with</p>
  
  <pre><code>error_bad_lines=False
  </code></pre>
  
  <p>A warning is printed when a bad line is encountered. However, I want to keep a record of all the bad line numbers to feed into another program. Is there an easy way of doing that?</p>
  
  <p>I thought about iterating over the file with a</p>
  
  <pre><code>chunksize=1
  </code></pre>
  
  <p>and catching the CParserError that ought to be thrown for each bad line encountered. When I do this though no CParserError is thrown for bad lines so I can't catch them.</p>