I want to know the Teams who spent more than £8 Million on agent fees, and finished lower than 10th position (as of 4th of April, when the BBC article on agent and Estimated fees was written).

The results may suggest that the agents for these teams could do a better job, as the teams they scout players for sit in the bottom half of the table!Now suppose, we want to query another condition.

This time, however we do not want the entire record (row) returned.

To achieve this, simply write the filter condition followed by a period and then the column you want to return.

Here, I only want to know the name of the Teams who have been estimated to spend more than £60 million on transfers and received a payment merit of less than £20 million.

It looks like Bournemouth, Brighton and Fulham spend big, but do recoup that investment very well in Merit-based prize money.

Its not looking good so far, financially for these teams compared to the rest!For comparison purposes, I have included what the returned result would look like if I did not use not notation followed by the column, ‘Team’.

Here, the entire record or row is returned.

Finally, I will conclude, by demonstrating how a simple aggregate function can be used.

Firstly, the mean (in £ million) for agent spending for all the teams in the Premier league is calculated.

Two different ways to achieve this result are shown, the first with square brackets, and the second using dot notation (more commonly used), and hence why illegal characters such as spaces needed to be removed and replaced with underscores earlier.

Lets suppose you want to find out the mean UK Broadcast games for the top and bottom half teams of the Premier league separately.

To gain further insight, it would be interesting to determine the difference between average Broadcast games for teams in the top half of the table versus the bottom half of the table.

Simply use .

loc then select the first 10 rows using [:10 followed by a comma, and finally the column in quotations followed by a closing square bracket.

Repeat this for the second half of the table, [10: , and we can clearly see that teams in the top half have on average 8.

49 more UK broadcast games compared with teams that reside in the bottom half.

I hope this example has demonstrated some useful Pandas features to make data handling and management that little bit easier.

If you liked the Premier League example, I have written an introductory article entitled ‘Pandas in the Premier League’ which shows how Pandas can help with initial data clean up.