I have this piece of code to try to execute this program for each csv file:
import pandas as pd
import os
directory_path_csv = r'CSV_Files'
for file in os.listdir(directory_path_csv):
if file.endswith(".csv"):
filename = file
df = pd.read_csv(filename, usecols= ['date','time', 'toto','tata'], parse_dates=[['date', 'time']])
But I have this error: FileNotFoundError: [Errno 2] File File1.csv does not exist: 'File.csv' and don't understand why ? In the csv folder, I can have csv file with no data just the column's names.
Thanks for your time !
fileis in the folderdirectory_path_csvso you need to doos.path.join(directory_path_csv, file)