In R/dplyr, I can do
summarise(iris, max_width=max(Sepal.Width), min_width=min(Sepal.Width))
and get:
max_width min_width
1 4.4 2
Is there something similar to summarise
in pandas? I know describe()
, but I would like the result to only contain a given summary statistic for a given column, not all summary statistics for all columns. In pandas, iris.describe()
gives:
sepal_length sepal_width petal_length petal_width
count 150.000000 150.000000 150.000000 150.000000
mean 5.843333 3.057333 3.758000 1.199333
std 0.828066 0.435866 1.765298 0.762238
min 4.300000 2.000000 1.000000 0.100000
25% 5.100000 2.800000 1.600000 0.300000
50% 5.800000 3.000000 4.350000 1.300000
75% 6.400000 3.300000 5.100000 1.800000
max 7.900000 4.400000 6.900000 2.500000