In [1]:
import pandas as pd
sal = pd.read_csv('Salaries.csv')
What is the job title of JOSEPH DRISCOLL ? Note: Use all caps, otherwise you may get an answer that doesn't match up (there is also a lowercase Joseph Driscoll).
sal[sal['EmployeeName']=='JOSEPH DRISCOLL']['JobTitle']¶
How much does JOSEPH DRISCOLL make (including benefits)?
sal[sal['EmployeeName']=='JOSEPH DRISCOLL']['TotalPayBenefits']¶
In [3]:
sal.head(1)
Out[3]:
In [7]:
sal[sal['EmployeeName']=='JOSEPH DRISCOLL']['JobTitle']
Out[7]:
In [8]:
sal[sal['EmployeeName']=='JOSEPH DRISCOLL']['TotalPayBenefits']
Out[8]:
What is the name of highest paid person (including benefits)?
sal[sal['TotalPayBenefits']== sal['TotalPayBenefits'].max()]¶
In [9]:
sal['TotalPayBenefits'].max()
Out[9]:
In [11]:
sal[sal['TotalPayBenefits']== sal['TotalPayBenefits'].max()]['EmployeeName']
Out[11]:
In [12]:
sal.loc[sal['TotalPayBenefits'].idxmax()]
Out[12]:
In [16]:
sal['TotalPayBenefits'].idxmax()
Out[16]:
In [20]:
sal.loc[sal['TotalPayBenefits'].idxmax()]["EmployeeName"]
Out[20]:
In [18]:
sal.loc[0]["EmployeeName"]
Out[18]:
No comments:
Post a Comment