I have a data file which consists the name of cities, their ID code and the amount of salary in these countries and some more information. I wanted to make a table with using groupby method and groupby(coutry id and city) and find the mean salary value.
I solve this problem like this:

```
file.groupby(['country_id',"city"])['salary'].mean()

```

This code is showing me the mean value of whole salaries. If I want to divide salaries into some ranges for example mean salary value in range (0,5000) and (5000,10000), what is the easiest method to do that? Is there any other way that writing 2 loops?