I have the following code in jupyter notebook:
import h5py
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_hdf('accounting-2018-10-deid.h5', 'table')
df.columns
Out[4]:
Index(['group', 'owner', 'job_number', 'submission_time', 'start_time',
'end_time', 'failed', 'exit_status', 'granted_pe', 'slots',
'task_number', 'maxvmem', 'h_data', 'h_rt', 'highp', 'exclusive',
'h_vmem', 'gpu', 'pe', 'slot', 'wait_time', 'wtime', 'campus'],
dtype='object')
The meanings of the columns:
owner: the owner of a job
group: the group a owner belongs to; a group can have one or more owners
The task is: For each group, list the number of users, and list all of these users (i.e. the users having the same “group” field). For example: group 1 (4 users): user2, user32, user41, user56?
I tried to use groupby() but didn't get right answer. Please, help me.