I have the following:
count = a[(a.type == 'exact') & (a.score == 1.0)].groupby('id').count()['type']
countbyid = pd.DataFrame(data = count)
Which gives me the following:
id type
102116 578
1256 1211
126805 215
31560 12
329401 2310
49923 375
9691 2409
When I try to add column names to countbyid = pd.DataFrame(data = count, columns = ['customer', 'department']) NO data is returned, only the column names:
customer department