I am using the below method to read in entire folder of csv's. These csv's are dropped in a folder every day and reflect activity that has occurred. When no activity occurs the csv is blank and still has a size of 1KB. How can I use this script to skip empty files that still have a file size? Currently I get the error:
EmptyDataError: No columns to parse from file
Current code:
os.chdir('file_path')
file_extension = '.csv'
all_filenames = [i for i in glob.glob(f"*{file_extension}")]
df = pd.concat([pd.read_csv(t) for t in all_filenames], ignore_index=True,sort=False,axis=0)