Created
June 13, 2019 00:44
-
-
Save Seanny123/5ecb65b67f6c30f3b93276388e4d2800 to your computer and use it in GitHub Desktop.
Get amount of time working for MLH from SaveMyTime tracker.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
def mili_to_h(mili): | |
return mili / 60 / 60 / 1000 | |
df = pd.read_csv("SaveMyTime export 12_06_2018 to 13_06_2019.csv") | |
mlh = df[df["activityName"] == "MLH"] | |
gitkraken_start = pd.Timestamp("2019-05-01 00:00") | |
ibm_start = pd.Timestamp("2019-05-20 00:00") | |
mean_start = pd.Timestamp("2019-05-28 17:00") | |
mlh = mlh.set_index(pd.DatetimeIndex(mlh["activityStartDate"])) | |
mili_to_h(mlh.loc[(mlh.index > gitkraken_start) & (mlh.index < ibm_start)]["activityDuration [ms]"].sum()) | |
mili_to_h(mlh.loc[(mlh.index > ibm_start) & (mlh.index < mean_start)]["activityDuration [ms]"].sum()) | |
mili_to_h(mlh.loc[mlh.index > mean_start]["activityDuration [ms]"].sum()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment