title: How to delete some rows with comments from a CSV file to load data to DataFrame?
body: <p>There is a relatively big CSV file with data (around 80Mb). When I open it in MS Excel, I see that it contains 100 columns with many rows of data. However, the first row is not the column names, it's a web link. Furthermore, the last two rows are some comments.
  So, now I want to load this data into pandas DataFrame:</p>
  
  <pre><code>import pandas as pd
  df = pd.read_csv('myfile.csv')
  </code></pre>
  
  <p>Then I want to read a column called <code>Duration</code> (I see that it exists in CSV file) and delete a word <code>years</code> from it's values:</p>
  
  <pre><code>Duration = map(lambda x: float(x.rstrip('years')), df['Duration'])
  </code></pre>
  
  <p>It gives me this error:</p>
  
  <pre><code>AttributeError: 'float' object has no attribute 'rstrip'
  </code></pre>
  
  <p>If I open the file in MS Excel and delete the first row (a web link) and the last two rows (the comments), then the code works!</p>
  
  <p>So, how can I clean this CSV file automatically in Python (to extract only columns with values)?</p>
  
  <p><strong>Update:</strong>
  When I write <code>print df.head()</code>, it outputs:</p>
  
  <pre><code>have mixed types. Specify dtype option on import or set low_memory=False.
  </code></pre>
  
  <p>Do I need ot specify Type for all 100 columns? What if I don't know the types apriori.</p>
  
  <p><strong>Update:</strong>
  I cannot attach the file, but as an example you can check <a href="https://www.lendingclub.com/info/download-data.action" rel="nofollow">this one</a>. 
  Download the file 2015-2016.</p>