0% found this document useful (0 votes)
6 views6 pages

LAB 1 (1) - Merged

The document outlines a series of lab exercises conducted by Shorya Agarwal in a Computational Linguistics and NLP Lab. Lab 1 involves data analysis using Python, including reading a salary dataset, calculating average salaries by job title, education level, and gender, and visualizing the results with a bar plot. Labs 2 and 3 are mentioned but contain no additional information.

Uploaded by

Aryan Gulia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

LAB 1 (1) - Merged

The document outlines a series of lab exercises conducted by Shorya Agarwal in a Computational Linguistics and NLP Lab. Lab 1 involves data analysis using Python, including reading a salary dataset, calculating average salaries by job title, education level, and gender, and visualizing the results with a bar plot. Labs 2 and 3 are mentioned but contain no additional information.

Uploaded by

Aryan Gulia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Computational Linguistics & NLP Lab

Shorya Agarwal
500096592
R2142211150
B-5 AI&ML

LAB -1
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

df=pd.read_csv("Salary Data.csv")
df.describe()
df.head(20)

average_salary = df.groupby('Job Title')['Salary'].mean()


print(average_salary)

avg_salary=df.groupby("Education Level")["Salary"].mean()
print(avg_salary)

avg_salary_gender=df.groupby("Gender")["Salary"].mean()
print(avg_salary_gender)

average_salary.plot(kind="bar",color="darkblue")
plt.xlabel('Job Title')
plt.ylabel('average_salary')
plt.title('Mean Salary per Job Title')

plt.xticks(rotation=45, ha='right')

# Show the plot


plt.tight_layout()
plt.show()
Computational Linguistics & NLP Lab
Shorya Agarwal
500096592
R2142211150
B-5 AI&ML

LAB -2
Computational Linguistics & NLP Lab
Shorya Agarwal
500096592
R2142211150
B-5 AI&ML

LAB -3

You might also like