0

I've been following these links:

Import multiple excel files into python pandas and concatenate them into one dataframe & Import multiple csv files into pandas and concatenate into one DataFrame

But I'm still unable to resolve the issue. I've not even tried to combine all the sheets yet, as I'm unable to even get them imported. The error I'm getting is saying the sheet name does not exist.

path = ('E:\\Python\\Projects\\big data\\Source Data\\convert')
fileNames = (glob.glob(path + '/*.XLSX') )
dataFrame_set = []
for files in fileNames:
    dataFrame_set.append(pd.read_excel(files,'/*'))
Community
  • 1
  • 1
  • using pd.read_excel will return a dataframe. It looks like you're trying to store multiple dataframes in a list, which I'm not sure is what you're looking to do. Try changing dataFrame_set = [] to dataFrame_set = pd.DataFrame() – DataSwede Aug 07 '14 at 16:15
  • I was able to get passed the sheet name problem by adding sheetname=0 – Aka_Minimal Aug 07 '14 at 16:45
  • Oh- were you trying to just collect the names of the files? Or actual data stored within the excel files? – DataSwede Aug 07 '14 at 16:49
  • Also ty for letting me know about creating a single DB. The newest issue with my excel files, the converter I used broke a a lot of them. Could you recommended a good .csv -> .xlsx converter? – Aka_Minimal Aug 07 '14 at 17:03
  • I'd like to import all the files and have them stored as a single DB. As I stands, I was collecting all the names into a list, parsing it for each name, and adding that file. (At least that's what I think i'm doing, I just started programming about 3 months, and panda last week, so I'm still very new to this. – Aka_Minimal Aug 07 '14 at 17:05
  • Oh ok, that explains a little more of what you were doing. Since I literally use pandas every day I would use pandas->read_csv to create a df, then pandas->to_excel to save the excel files. There may be a better method, but it that would be the easiest for me to set up – DataSwede Aug 07 '14 at 17:58
  • I will give that a try. Seems a bit easier. – Aka_Minimal Aug 07 '14 at 19:44

0 Answers0