Combine dictionary of dataframes into 1 single dataframe

Viewed 11673

I am looking for a solution to put all my dataframes which are in a dictionary into 1 single giant dataframe. I am relatively new to Python so I am unable to understand how to iterate over a dictionary and put all the dataframes into 1. The code I have implemented so far, is as below:

import sys
from ftplib import FTP
import os
import socket
import time
import pandas as pd
import numpy as np
from glob import glob

path = 'path_to_file'

files = glob(path + '/*Mail*.xlsx')

print files

get_df = lambda f: pd.read_excel(f, sheetname=None)

dodf = {f: get_df(f) for f in files}  ### dictionary of dataframes

Now, I need to put all the different dataframes into 1 dataframe and then do my operations on that. Any advise would be appreciated.

I have tried this,

for df in dodf:
pd.concat(dodf.values(), ignore_index=True)

But it does not seem to work right.

2 Answers
Related