import pandas as pd
SELECT *
FROM 'Levels_Fyi_Salary_Data.csv'
type(data)
input_date
data['timestamp'] = data['timestamp'].astype('datetime64[ns]')
data['new_date'] = [d.date() for d in data['timestamp']]
data['new_time'] = [d.time() for d in data['timestamp']]
data[data['new_date']==input_date.date()]
Company
import plotly.express as px
data_company = data.query(f"company == '{Company}'")
fig = px.histogram(data_company, x='title',labels={'title':'Job Title'},title=f'{Company} Jobs Distribution ')
fig.show()
year_XP
35 / 41
data.yearsofexperience = round(data.yearsofexperience, 0)
num_of_emp = data[data["yearsofexperience"] == year_XP].shape[0]
mean_salary = (
data[data["yearsofexperience"] == year_XP].basesalary.mean().round().astype(int)
)
print(
f"There are {num_of_emp} employees with {year_XP} years of experience that have mean base salary {mean_salary} USD"
)
JobTitle
df = data.query(f"title=='{JobTitle}'")
fig = px.line(
df,
x="timestamp",
y="totalyearlycompensation",
title=f"{JobTitle}s Yearly Compensation",
)
fig.show()
year
year = int(year)
df_base = data[data["timestamp"].dt.year==year]
fig = px.histogram(df_base, x='title',labels={'title':'Job Title'},title=f'{year} Jobs Distribution ')
fig.show()