0

maybe someone has a good idea. I had generate a complete list of all gz files between to timestamps. The list looks like that:

/media/PROJEKTE_SHARE/2019/2019-07-29/wind_reconstruction_data/23-00/WLS200s-92_WindReconstructionData_2019-07-29_23-59-31_DBS_26_50m.csv.gz
/media/PROJEKTE_SHARE/2019/2019-07-29/wind_reconstruction_data/23-00/WLS200s-92_WindReconstructionData_2019-07-29_23-59-50_DBS_26_50m.csv.gz
/media/PROJEKTE_SHARE/2019/2019-07-30/wind_reconstruction_data/00-00/WLS200s-92_WindReconstructionData_2019-07-30_00-00-46_DBS_26_50m.csv.gz
/media/PROJEKTE_SHARE/2019/2019-07-30/wind_reconstruction_data/00-00/WLS200s-92_WindReconstructionData_2019-07-30_00-01-06_DBS_26_50m.csv.gz

If I want to plot a plot for every day I first have to append them together. This is easy if I have only one day. Actually I have no idea how to split the list and generate after that a dayfile for plotting them...

Thanks.

S.Kociok
  • 168
  • 1
  • 14

1 Answers1

0

Make use of collections.Counter to count occurence of files against each date. Then use matplotlib to plot aggregated dict.

from collections import Counter
import matplotlib.pyplot as plt

counts = Counter([f.split("/")[4] for f in files]).items()
# dict_items([('2019-07-29', 2), ('2019-07-30', 2)])

plt.bar(*zip(*counts))
plt.show()

enter image description here

sushanth
  • 8,275
  • 3
  • 17
  • 28