I have a csv file with several columns of data, but I'm only interested in two, the nationality and the commune (region) where they live, obviously the two columns are not numerical data, something like this:
'index', 'comuna_name', 'country_name'
My idea is to count how many people of each nationality live in a certain commune, so far I am using this code
fa = (total.groupby('comuna_name')
.aggregate({'country_name': 'sum'})
.sort_values('country_name'))
The problem is that the exit does not deliver me in numbers, but "unites" the countries in this way
The question in essence is how to do in order to count the countries, to later graph. Thanks