0

Im Trying to import multiple workbooks to python to compile them all together.

I have every part of the code working, but when I view the new data frame, there is required data in the index column which means that when I export it again to excel it doesn't appear. Here is the code so far

all_needed = pd.DataFrame()
blankk = [range(len(df))]
blank = []
for i in glob.glob(path + "/*.xls"):
    df=pd.read_excel(i,index_col = None)
    df.insert(0,"blank",5)
    df.reindex(index = "blank")

How do I remove this data from the index column and place it as part of the data set ?

Many thanks for the help

Dawa14
  • 13
  • 2
  • Sorry forgot to delete the blank and blankk statements they were as a trial to see if they could be used to replace the index – Dawa14 Jan 07 '20 at 17:31
  • It's not exactly clear what you're asking. Please have a look at [How to make good pandas examples](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) and provide a [mcve] for your issue with sample input, sample output, and how the desired output is different from the current output – G. Anderson Jan 07 '20 at 17:40
  • 2
    Very likely that you want ``df.reset_index()`` – Nathan Furnal Jan 07 '20 at 17:50

0 Answers0