-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplots.py
More file actions
executable file
·25 lines (21 loc) · 792 Bytes
/
plots.py
File metadata and controls
executable file
·25 lines (21 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /usr/bin/env python3
from cProfile import label
from re import X
from turtle import title
import pandas as pd
import matplotlib.pyplot as plt
import os
productivity_folder = os.path.join(os.path.expanduser('~'),"Documents","productivity-tracker")
productivity_file= os.path.join(productivity_folder,"productivity.csv")
if not os.path.isdir(productivity_folder):
os.mkdir(productivity_folder)
df = pd.read_csv(productivity_file)
print(df)
sumcolumn = (df["timeout"] - df["timein"])/60
df["difference"] = sumcolumn
sum = df["difference"].sum()
print(round(sum))
#figure, axes = plt.subplots(1, 2)
df.plot(y = "difference",x="activity",label = " Time in minutes",title = f"You Utilized {round(sum)} minutes productively today",kind = "bar")
plt.xticks(rotation=0)
plt.show()