zztin / ctimer

This is a python implementation of a famous time management technique. CTimer helps you keep track of your productivity during the day, and help you set realistic goals for your day.
Apache License 2.0
0 stars 1 forks source link

[Feature Request][--overall] show average pomodoro number #40

Open tai271828 opened 3 years ago

tai271828 commented 3 years ago

Describe the solution you'd like

It will be great if we could show average pomodoro number when invoking --overall.

Describe alternatives you've considered

  1. UI: the information could be revealed on the terminal stdout, or calmap plot.
  2. type: average over all period, or average for weekdays only.
  3. code snippet candidates of implementation

the whole period

df['clock_count']
events[0].dt.floor('d')
events.groupby(events.dt.floor('d'))
events.index.dt.floor('d')
events['date']=events.index
events['date'].floor('d')
events.date = events['date'].floor('d')
events.groupby('date')
events.date.value_counts()
tai.sum()
tai = events.date.value_counts()
import numpy as np
np.average(tai.values.sum() )
tai.values.sum()

weekday only

pd.DataFrame(events)
events = pd.DataFrame(events)
events.date = events.index
events['date'] = events.index
events['weekday'] = events.date.dayofweek

new['date'] = new.index.floor('d')
events['date'] = events.index.floor('d')
events.head()
new = events[(events['weekday'] == 1 )| (events['weekday'] == 2 ) | (events['weekday'] == 3 ) | (events['weekday'] == 4 ) | (events['weekday'] == 0 )]
tai = new.groupby("date")
tai.count().sum()