Computer scienceData scienceInstrumentsPandasData analysis with pandas

Crosstab in pandas

The lost line

Report a typo

You have a fragment of a dataframe:

   Type  Count
0     A      1
1     A      2
2     B      3
3     B      4
4     B      5
5     A      2
6     A      3
7     A      3
8     B      4
9     B      5
10    A      2
11    B      3

Which line would produce the following output:

Count  1  2  3  4  5  All
Type                     
A      1  3  2  0  0    6
B      0  0  2  2  2    6
All    1  3  4  2  2   12
Select one option from the list
___

Create a free account to access the full topic