Our DataFrame is the list of French mayors in 2014:
https://www.data.gouv.fr/storage/f/2014-04-25T17-51-58/maires-25-04-2014.xlsx
this file is also in data/maires-25-04-2014.xlsx
so no reason to reload it...
We can see there are issues:
Show head of the resulting DataFrame.
Note: it can be useful to reaload the DataFrame with the right arguments.
Lisez la doc de read_excel
et recharger le tableau avec les bonnes options pour avoir directement le tableau parfait, sans aucunes des corrections précédentes à faire.
Birth and population are useless String, cast them to what they should be.
Use the birthdate to add a column 'age'. You may need to compute in year since TimeDelta are in days by default.
Let's group all cities of the same department and
np.sum
np.mean
np.size