Jon Reades - j.reades@ucl.ac.uk
1st October 2025
Method | Achieves |
---|---|
count() |
Total number of items |
first() , last() |
First and last item |
mean() , median() |
Mean and median |
min() , max() |
Minimum and maximum |
std() , var() |
Standard deviation and variance |
mad() |
Mean absolute deviation |
prod() |
Product of all items |
sum() |
Sum of all items |
In Pandas these follow a split / apply / combine approach:
For instance, if we had a Local Authority (LA
) field:
Using apply
the function could be anything:
A ‘special case’ of Group By features:
pandas.cut(<series>, <bins>)
can be a useful feature here since it chops a continuous feature into bins suitable for grouping.