Loading multiple csv files of a folder into one dataframe
I suggest use list comprehension with concat
:
import glob
import pandas as pd
files = glob.glob("TransactionData\Promorelevant*.csv")
dfs = [pd.read_csv(f, header=None, sep=";") for f in files]
salesdata = pd.concat(dfs,ignore_index=True)
With a help from link to actual answer
This seems to be the best one liner:
import glob, os
df = pd.concat(map(pd.read_csv, glob.glob(os.path.join('', "*.csv"))))