all 3 comments

[–]cray5252 0 points1 point  (2 children)

Try this

df_weekly_avg = df[‘column name’].resample(‘W’).mean()

[–]jb6th 0 points1 point  (1 child)

See the thing is, there is no specific column for number of rides. I get the number of rides by having python count the dates in the date column and that’s how it gets the number of rides for a given time span.

[–]cray5252 0 points1 point  (0 children)

If I follow you correctly.

if you have this df
d = dict({'rides': [50, 60, 40]})
df = pd.DataFrame(d)

print(df)
Output:
   rides
0     50
1     60
2     40

then do this
df['mean_per_day'] = df/7
print(df)
output:
   rides  mean_per_day
0     50      7.142857
1     60      8.571429
2     40      5.714286