title: Comparing number of lines in a CSV compared to number successfully processed into dataframe by Pandas?
body: <p>We are using Pandas to read a CSV into a dataframe:</p>
  <pre><code> someDataframe = pandas.read_csv(
          filepath_or_buffer=our_filepath_here,
          error_bad_lines=False,
          warn_bad_lines=True
      )
  </code></pre>
  <p>Since we are allowing bad lines to be skipped, we want to be able to track how many have been skipped and put it into a value so that we can metric off of it.</p>
  <p>To do this, I was thinking of comparing how many rows we have in the dataframe vs the number of rows in the original file.</p>
  <p>I think this does what I want:</p>
  <pre><code>someDataframe = pandas.read_csv(
     filepath_or_buffer=our_filepath_here,
     error_bad_lines=False,
     warn_bad_lines=True
  )
  
  initialRowCount = sum(1 for line in open('our_filepath_here'))
  difference = initialRowCount - len(someDataframe.index))
  </code></pre>
  <p>But the hardware running this is super limited and I would rather not open the file and iterate through the whole thing just to get a row count when we're already going through the whole thing once via .read_csv. Does anyone know of a better way to get both the successfully processed count and the initial row count for the CSV?</p>