0

I'm looping thru several .xlsx files in a folder and spitting out their column names like so.

import openpyxl 
import os
import glob
import numpy as np
import pandas as pd

glob.glob("c:/myfolder/*.xlsx")
all_sheets_data = pd.DataFrame()
for f in glob.glob("c:\\myfolder\\*.xlsx"):
df = pd.read_excel(f)
all_sheets_data = all_data.append(df,ignore_index=True)
print (df)

I'm looking to add a new column called "RESULTS". I want to add/insert it in the very left column. I've searched for Add Column help but haven't found anything that works. Any suggestions, would really appreciate it.

skintPaul
  • 11
  • 1
  • 4
  • Check the following answer: How to add new column and row to .xls file using xlrd http://stackoverflow.com/questions/10763690/how-to-add-new-column-and-row-to-xls-file-using-xlrd – saloua Feb 06 '17 at 02:14
  • this appears to only cover .xls files, not .xlsx files. It doesnt mention adding a column to a file either. Have I misunderstood ? – skintPaul Feb 07 '17 at 22:19

0 Answers0