Skip to content

Instantly share code, notes, and snippets.

@parulnith
Last active August 12, 2021 00:24
Show Gist options
  • Save parulnith/9636bbada7a8dd0a5547ca09aea61450 to your computer and use it in GitHub Desktop.
Save parulnith/9636bbada7a8dd0a5547ca09aea61450 to your computer and use it in GitHub Desktop.
# Renaming the column
se.rename(columns = {'Yearly bonus + stocks in EUR': 'Salary with Stocks'}, inplace=True)
# Creating a dataframe salary_exp2 containing salary with stocks and bonuses
se['Salary with Stocks'] = se['Salary with Stocks'].astype(int)
salary_exp2 = se.groupby(['Total years of experience'])['Salary with Stocks'].median().to_frame().reset_index()
salary_exp2[['Total years of experience','Salary with Stocks']] = salary_exp2[['Total years of experience','Salary with Stocks']].astype(int)
salary_exp2.sort_values('Total years of experience',inplace=True)
# Drawing a Radat Chart
chart = ctc.Radar("Median compensation by years of experience")
chart.set_options(
labels=list(salary_exp[:5]['Total years of experience'])
)
chart.add_series("Salary", list(salary_exp[:5]['Salary']))
chart.add_series("Salary with Stocks", list(salary_exp2[:5]['Salary with Stocks']))
# Calling the load_javascript function when rendering chart first time.
chart.load_javascript()
chart.render_notebook()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment