title: DataFrame object has no attribute 'name'
body: <p>I currently have a list of Pandas DataFrames. I'm trying to perform an operation on each list element (i.e. each DataFrame contained in the list) and then save that DataFrame to a CSV file.</p>
  
  <p>I assigned a <code>name</code> attribute to each DataFrame, but I realized that in some cases the program throws an error <code>AttributeError: 'DataFrame' object has no attribute 'name'</code>.</p>
  
  <p>Here's the code that I have.</p>
  
  <pre><code># raw_og contains the file names for each CSV file.
  # df_og is the list containing the DataFrame of each file.
  for idx, file in enumerate(raw_og):
      df_og.append(pd.read_csv(os.path.join(data_og_dir, 'raw', file)))
      df_og[idx].name = file
  
  # I'm basically checking if the DataFrame is in reverse-chronological order using the
  # check_reverse function. If it is then I simply reverse the order and save the file.
  for df in df_og:
      if (check_reverse(df)):
          df = df[::-1]
          df.to_csv(os.path.join(data_og_dir, 'raw_new', df.name), index=False)
      else:
          continue
  </code></pre>
  
  <p>The program is throwing an error in the second for loop where I used <code>df.name</code>.</p>
  
  <p>This is especially strange because when I run <code>print(df.name)</code> it prints out the file name. Would anybody happen to know what I'm doing wrong?</p>
  
  <p>Thank you.</p>