Jul-01-2024, 06:26 AM
Basically, I want to get the sums of the traffic count by site reference and vehicle class for each month. As part of the data cleaning I filter out site references that have less than 60 months of traffic activity, I then filter out site reference that have been duplicated (not many, only like 8 have this issues). I also filter out 2017-12 because the counts are weird so the data starts from Jan 2018. After all these filters the dataframe is probably still too big for a loop so keen to hear any ideas about how to go about this.
For site reference with no traffic, it should have 0. When there is no data for the day (i.e. row missing it is assumed the meter was down for that date.) I want to fill in the data for when the meter was down by taking the average of the last 7 days for that site reference by vehicle (heavy, light) and using that amount.
Does that clarify? I can share all my code if that is unclear.
Thanks
For site reference with no traffic, it should have 0. When there is no data for the day (i.e. row missing it is assumed the meter was down for that date.) I want to fill in the data for when the meter was down by taking the average of the last 7 days for that site reference by vehicle (heavy, light) and using that amount.
Does that clarify? I can share all my code if that is unclear.
Thanks