I have trying to learn Python on datacamp. When I run statistical codes with agg - like min, max - I realized that it is the same result with using np with these codes. But I can not use mean and median methods without np.
So,
is there any difference between np.min and min , np.max and max?
why don't median and mean work without numpy?
Code:
unemp_fuel_stats = sales.groupby("type")["unemployment",
"fuel_price_usd_per_l"].agg([np.min, np.max, np.mean, np.median])
Result:
unemployment fuel_price_usd_per_l
amin amax mean median amin amax mean median
type
A 3.879 8.992 7.973 8.067 0.664 1.107 0.745 0.735
B 7.170 9.765 9.279 9.199 0.760 1.108 0.806 0.803
Another result:
unemployment fuel_price_usd_per_l
min max min max
type
A 3.879 8.992 0.664 1.107
B 7.170 9.765 0.760 1.108