title: "No such file or directory error" while combining multiple excel sheets using python os and pandas
body: <p>I am using in python the code below to combine several identically structured excel files into only one big file:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import os
  import pandas as pd
  cwd = os.path.abspath('C:/Users/Helvio/historico') 
  files = os.listdir(cwd)  
  print(files)
  ## Method 1 gets the first sheet of a given file
  df = pd.DataFrame()
  for file in files:
      if file.endswith('.xlsx'):
          df = df.append(pd.read_excel(file), ignore_index=True) 
  df.head() 
  df.to_excel('momentum_cons.xlsx')</code></pre>
  </div>
  </div>
  </p>
  <p>I can see that cwd is pointing at the right place, as when I print(cwd) I can see the files on the working directory:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>['volume_20141230.xlsx', 'volume_20150130.xlsx', 'volume_20150227.xlsx', 'volume_20150331.xlsx', 'volume_20150430.xlsx', 'volume_20150529.xlsx', 'volume_20150630.xlsx', 'volume_20150731.xlsx', 'volume_20150831.xlsx', 'volume_20150930.xlsx', 'volume_20151030.xlsx', 'volume_20151130.xlsx', 'volume_20151230.xlsx', 'volume_20160129.xlsx', 'volume_20160229.xlsx', 'volume_20160331.xlsx', 'volume_20160429.xlsx', 'volume_20160531.xlsx', 'volume_20160630.xlsx', 'volume_20160729.xlsx', 'volume_20160831.xlsx', 'volume_20160930.xlsx', 'volume_20161031.xlsx', 'volume_20161130.xlsx', 'volume_20161229.xlsx', 'volume_20170131.xlsx', 'volume_20170224.xlsx', 'volume_20170331.xlsx', 'volume_20170428.xlsx', 'volume_20170531.xlsx', 'volume_20170630.xlsx', 'volume_20170731.xlsx', 'volume_20170831.xlsx', 'volume_20170929.xlsx', 'volume_20171031.xlsx', 'volume_20171130.xlsx', 'volume_20171228.xlsx', 'volume_20180131.xlsx', 'volume_20180228.xlsx', 'volume_20180329.xlsx', 'volume_20180430.xlsx', 'volume_20180530.xlsx', 'volume_20180629.xlsx', 'volume_20180731.xlsx', 'volume_20180831.xlsx', 'volume_20180928.xlsx', 'volume_20181031.xlsx', 'volume_20181130.xlsx', 'volume_20181228.xlsx', 'volume_20190131.xlsx', 'volume_20190228.xlsx', 'volume_20190329.xlsx', 'volume_20190430.xlsx', 'volume_20190531.xlsx', 'volume_20190628.xlsx', 'volume_20190731.xlsx', 'volume_20190830.xlsx', 'volume_20190930.xlsx', 'volume_20191031.xlsx', 'volume_20191129.xlsx', 'volume_20191230.xlsx', 'volume_20200131.xlsx', 'volume_20200228.xlsx', 'volume_20200331.xlsx', 'volume_20200430.xlsx', 'volume_20200529.xlsx', 'volume_20200630.xlsx', 'volume_20200731.xlsx', 'volume_20200831.xlsx', 'volume_20200930.xlsx', 'volume_20201030.xlsx', 'volume_20201130.xlsx', 'volume_20201230.xlsx', 'volume_20210129.xlsx', 'volume_20210226.xlsx', 'volume_20210331.xlsx', 'volume_20210430.xlsx', 'volume_20210531.xlsx', 'volume_20210630.xlsx']</code></pre>
  </div>
  </div>
  </p>
  <p>When I run the code above, though, I receive the following error:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\common.py", line 651, in get_handle
      handle = open(handle, ioargs.mode)
  
  FileNotFoundError: [Errno 2] No such file or directory: 'volume_20141230.xlsx'</code></pre>
  </div>
  </div>
  </p>
  <p>Any thoughts how to handle it?</p>