title: How to handle memory error on book.parse(sheet)
body: <h1>Getting a memory error  on book.parse(sheet)</h1>
  <p>I am getting a memory error after reading a few files in the directory on <code>book.parse(sheet)</code></p>
  <pre><code>for filename in os.listdir(cwd):
          if filename.endswith('.xlsx') and not filename.startswith(('1Data')):
              book = pd.ExcelFile(filename)
              print(filename)
              for sheet in book.sheet_names:
                  df = book.parse(sheet) #how can i handle this 
                  if 'comp' in df.columns:
                      df['comp1']=df['comp']
                      print(&quot;For &quot;+filename+&quot;\n&quot;)
                      book2=df.pivot_table(values='comp1',index=['pe','id'], columns='comp', aggfunc='count',margins=True)
                 
  </code></pre>