csv file to be read
file name:salaries.csv
Q:sort cities by descending order of lawyer salary.
City,Job,Salary
Delhi,Doctors,500
Delhi,Lawyers,400
Delhi,Plumbers,100
London,Doctors,800
London,Lawyers,700
London,Plumbers,300
Tokyo,Doctors,900
Tokyo,Lawyers,800
Tokyo,Plumbers,400
Lawyers,Doctors,300
Lawyers,Lawyers,400
Lawyers,Plumbers,500
Hong Kong,Doctors,1800
Hong Kong,Lawyers,1100
Hong Kong,Plumbers,1000
Moscow,Doctors,300
Moscow,Lawyers,200
Moscow,Plumbers,100
Berlin,Doctors,800
Berlin,Plumbers,900
Paris,Doctors,900
Paris,Lawyers,800
Paris,Plumbers,500
Paris,Dog catchers,400
output ex
Tokyo,800
London,700
Delhi,400
...
-1
-
@MohitBhasi If not interested please stay away instead of wasting time posting such comments.There are people to help.You are discouraging and hurting. – Balajee Feb 21 '15 at 15:36
-
I am suggesting you to put in some effort and give it a try , I am not trying to be offensive – Mohit Bhasi Feb 21 '15 at 15:38
0
>>> df[df.Job == 'Lawyers'].sort('Salary', ascending=False).City
>>>
13 Hong Kong
7 Tokyo
21 Paris
4 London
1 Delhi
10 Lawyers
16 Moscow