tinymlaas-devel / README.md
doyu's picture
add pandas usage
571c2ab
|
raw
history blame
1.11 kB

uoh-software-project-time-report

This file will become your README and also the index of your documentation.

Install

pip install uoh_software_project_time_report

How to use

Fill me in please! Don’t forget code examples:

pr = Project('key.json')
pr
1DNoNf4glcuMxKoVzHVrFo-MktmsVji1wf4IHeraWH84
pr.get()
[['name', 'backlog item #', 'hours spent', 'date'],
 ['Hiroshi Doyu', '25', '1', '2022/1/16'],
 ['Michihito Mizutani', '28', '1', '2022/1/16']]
import pandas as pd
df = pd.DataFrame(pr.get())
df.columns = df.iloc[0]
df = df[1:]
df['backlog item #'] = df['backlog item #'].astype(int)
df['hours spent'] = df['hours spent'].astype(int)
df.date = pd.to_datetime(df.date)
df.date = df.date.dt.strftime("%Y-%m-%d")
pr.put([df.columns.tolist()] + df.values.tolist())
pr.get()
[['name', 'backlog item #', 'hours spent', 'date'],
 ['Hiroshi Doyu', '25', '1', '2022/1/16'],
 ['Michihito Mizutani', '28', '1', '2022/1/16']]