this is my first post :). I have to check that each csv contains data - hence that the number of rows > 1 (accounting for header).
I am therefor trying to append to a dic the
- name of the file
- number of rows
So far, I get the name of the file in my dict but not the number of rows and instead the length of the path + file name
import glob
import csv
all_files = glob.glob(path + '*.csv')
dic = {}
for file in all_files:
dic[file] = len(list(csv.reader(file)))
Thank you all very much!