mirror of
https://github.com/thilobillerbeck/dotfiles.git
synced 2024-12-23 20:33:04 +01:00
15 lines
No EOL
450 B
Python
15 lines
No EOL
450 B
Python
#!/usr/bin/env python3
|
|
|
|
import pandas as pd
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
df = pd.read_csv(sys.argv[1])
|
|
|
|
df = df.drop(columns=['User', 'Email', 'Billable', 'Tags', 'Amount ()', 'Start time', 'End date', 'End time'])
|
|
df['Duration'] = pd.to_timedelta(df['Duration'])
|
|
df['Start date'] = pd.to_datetime(df['Start date'])
|
|
|
|
df = df.groupby(['Project','Description','Start date'])['Duration'].sum()
|
|
|
|
df.to_csv(Path(sys.argv[1]).stem + '-grouped.csv') |