Reputation: 1118
I've a dataframe as mentioned below:
I'm using the following code to get the count of resolved
for all the items in column A
:
resolved = df[df['B']== 'resolved'].groupby('A', as_index=False)['B'].size()
and similarly for unresolved
:
unresolved = df[df['B']== 'unresolved'].groupby('A', as_index=False)['B'].size()
For unresolved
, SRVCAM-AM BI-Data
doesn't have unresolved
value in column B
. So, the resulting dataframe will not have it
The result obtained for unresolved
is as below:
work_queue count
SRVCAM-AM BI-Reports Admin 1
but I want the result as follows:
work_queue count
SRVCAM-AM BI-Reports Admin 1
SRVCAM-AM BI-Data 0
Upvotes: 1
Views: 148