I am trying to read several csv files from a directory into pandas and concatenate them into one big DataFrame but I have this error:
OSError: Initializing from file failed
Here is my code
import pandas as pd
import glob
path = r'C:/Users/chris/Downloads/Séance2/horodateurs-transactions-de- paiement'
all_files = glob.glob(path + "/*.csv")
transac = pd.DataFrame()
li = []
for filename in all_files:
df = pd.read_csv(filename, index_col=None, header=0)
li.append(df)
transac = pd.concat(li, axis=0, ignore_index=True)
I don't know why it doesn't work. I tried to solve the problem by using chmod but anything has changed