Business scenarios:
1. Read the data and store it in a data box named job_info. 2. Name the column [‘ company ‘, ‘position’, ‘location’, ‘salary’, ‘release date]. 3. Which positions are most in demand? 4. Take out the recruitment information posted on September 3. 5. Find job openings for data analysts based in Shenzhen.
Third, which positions are most in demand? Value_counts () counts the number of occurrences of each element in the post column
The core code
goal = Series.idxmax()
The sample
import pandas as pd
job_info = pd.read_csv('job_info.csv',header=None,names=('the company'.'jobs'.'Place of Work'.'wages'.'Release Date'),encoding = 'gbk')
a = job_info.loc[:,'jobs'].value_counts() # Count the number of occurrences of each element in the post column
b = a.idxmax() # Identify the most in-demand positions
data_9_3 = job_info[job_info['Release Date'] = ='09-03'] # Retrieve the job Posting for September 3
data5 = job_info[(job_info['Place of Work'] = ='shenzhen') & (job_info['jobs'] = ='Data analyst')] Find out recruitment information of data analyst based in Shenzhen
Copy the code