Output match

Report a typo

Here is a DataFrame you have:

   A  B    C
0  a  3  0.5
1  b  2  0.8
2  c  1  0.2
3  a  0  0.5
4  b -1  0.9

Match the following code lines with the right output.

Tip: Here is the DataFrame for convenience:

import pandas as pd
df = pd.DataFrame({'A': ['a', 'b', 'c', 'a', 'b'], 'B': [3, 2, 1, 0, -1], 'C': [0.5, 0.8, 0.2, 0.5, 0.9]})

Match the items from left and right columns
df.agg({'C': 'min'})
df.B.agg('unique')
df.C.agg('nunique')
df.groupby(['A']).agg({'B':'mean'}).max()
array([ 3, 2, 1, 0, -1], dtype=int64)
C 0.2 dtype: float64
4
B 1.5 dtype: float64
___

Create a free account to access the full topic