-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_processor.py
More file actions
26 lines (22 loc) · 867 Bytes
/
Copy pathdata_processor.py
File metadata and controls
26 lines (22 loc) · 867 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
26
import pandas as pd
def analyze_calendar_data(df):
# Perform analysis on the calendar data
total_meetings = len(df)
total_duration = df['duration'].sum()
avg_duration = df['duration'].mean()
avg_attendees = df['attendees'].mean()
# Group meetings by day
df['day'] = df['start'].dt.date
meetings_by_day = df.groupby('day').size()
# Group meetings by category
meetings_by_category = df.groupby('category').size()
duration_by_category = df.groupby('category')['duration'].sum()
return {
'total_meetings': total_meetings,
'total_duration': total_duration,
'avg_duration': avg_duration,
'avg_attendees': avg_attendees,
'meetings_by_day': meetings_by_day,
'meetings_by_category': meetings_by_category,
'duration_by_category': duration_by_category
}