zipped file --> 10folders --> 20 csv files for each folder
- the zipped file title is yyyy-mm
- folders titles are yyyy-mm-dd
- csv files titles are different timings of the day
tried the following code but does not work
import pandas as pd
import os
import glob
myzip=zipfile.ZipFile("C:/xxx/xxx/xxx/xxx/2021-01.zip")
for fname in myzip.namelist():
if 'csv' not in fname:
pathname = "C:/xxx/xxx/xxx/xxx/2021-01.zip/" + fname
path = os.getcwd()
csv_files = glob.glob(os.path.join(pathname, "*.csv"))
for f in csv_files:
# read the csv file
df = pd.read_csv(f)
# print the location and filename
print('Location:', f)
print('File Name:', f.split("\\")[-1])
# print the content
print('Content:')
display(df)
print()