<jupyter_start><jupyter_text>Read data:<jupyter_code># df = extract_data()
df = pd.read_csv('data/usnh_salary_book_2018_extracted.csv')
display(df)
df.info()<jupyter_output><empty_output><jupyter_text>Do some **preprocessing**!<jupyter_code>df['Annual Base Pay'] = df['Annual Base Pay'].apply(lambda x: x.lstrip('$').replace(',', ''))
df['Annual Base Pay'] = df['Annual Base Pay'].astype(float)<jupyter_output><empty_output><jupyter_text>The most frequent job title:<jupyter_code>df.groupby(by='Job Title').count().sort_values(['Campus'], ascending=False)
plt.figure()
df.groupby(by='Job Title').count()['Campus'].plot(kind='pie')
plt.show()<jupyter_output><empty_output><jupyter_text>The **highest salary** among **the New Hampshire universities**:<jupyter_code>max_salary = df['Annual Base Pay'].max()
max_salary_idx = df['Annual Base Pay'].idxmax()
display(df.iloc[max_salary_idx])<jupyter_output><empty_output><jupyter_text>The top 20 highest and lowest salaries:<jupyter_code>salaries_sorted = df.sort_values(by=['Annual Base Pay'], ascending=False)
highest_salaries = salaries_sorted.iloc[0:20]
lowest_salaries = salaries_sorted.iloc[-20:]
print('Highest salaries:')
display(highest_salaries)
print('Lowest salaries:')
display(lowest_salaries)<jupyter_output>Highest salaries:<jupyter_text>Some stats<jupyter_code>print('Average Salary:')
display(df['Annual Base Pay'].mean())
print('Mode:')
display(df['Annual Base Pay'].mode())
print('Median:')
display(df['Annual Base Pay'].median())<jupyter_output>Average Salary:<jupyter_text>-------Top 20 and bottom 20 Professors' salaries:<jupyter_code>prof_salaries = df.loc[df['Job Title'].str.lower().str.contains('professor')].sort_values(by='Annual Base Pay', ascending=False)
prof_top20 = prof_salaries.iloc[0:20].reset_index()
prof_bottom20 = prof_salaries.iloc[-20:].reset_index()
display(prof_top20)
display(prof_bottom20)


cs_names = ['Hatcher', 'Ruml',
            'Bartos', 'Petrik', 'Varki', 'Charpentier',
            'Dietz', 'Begum', '<NAME>' '<NAME>', '<NAME>',
            'Narayan', 'Magnusson', 'Hausner', '<NAME>', 'Gildersleeve',
            '<NAME>', 'Bochert', 'Plumlee', 'Lemon',
            'Kibler', 'Kitterman', 'Desmarais']
cs_salaries = salaries_individuals(cs_names)

oiss_names = ['<NAME>', 'Chiarantona']
oiss_salaries = salaries_individuals(oiss_names)

temp_names = ['<NAME>', 'Macmanes']
temp_salaries = salaries_individuals(temp_names)<jupyter_output><empty_output><jupyter_text>--------Find the name you're looking for:<jupyter_code>desired = salaries_individuals(['kun'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.178516228748068, 'fraction_numerical': 0.010819165378670788, 'mean_word_length': 8.31294964028777, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '147295', 'license': 'MIT', 'n_tokens_mistral': 998, 'n_tokens_neox': 947, 'n_words': 142, 'path': 'salaries.ipynb', 'repo_name': 'SHi-ON/DataVis', 'size': '2636'}