Commit 077033ffe5
Unsigned
Layout: unified · split
content/salary.md +11 −2
| @@ -3,7 +3,9 @@ title = "Salary" | ||
| 3 | 3 | draft = false |
| 4 | 4 | +++ |
| 5 | 5 | |
| 6 | # Salary Transparency | |
| 6 | <link rel="stylesheet" href="https://unpkg.com/charts.css/dist/charts.min.css"> | |
| 7 | ||
| 8 | ## Salary Transparency | |
| 7 | 9 | |
| 8 | 10 | The data below details the base salary information for each job I've held. This |
| 9 | 11 | information is posted publicly to ensure others in my position have a solid |
| @@ -24,7 +26,7 @@ paid differently (expertise, years of experience, certifications, education, | ||
| 24 | 26 | etc.) and that the data in this table should only be used as a single point of |
| 25 | 27 | reference, not the whole story. |
| 26 | 28 | |
| 27 | # Salary Data | |
| 29 | ## Salary Data | |
| 28 | 30 | |
| 29 | 31 | Note: When in a role that gives periodic raises, I will create a new record with |
| 30 | 32 | the new base salary in the table below. See the KPMG records for an example of a |
| @@ -43,6 +45,13 @@ raise while in the same role. | ||
| 43 | 45 | | Teaching Assistant | University of Nebraska | Lincoln, NE | 2017-08 | 2018-05 | $7/hour | |
| 44 | 46 | | Community Management Intern | Walgreens | Lincoln, NE | 2017-06 | 2018-02 | $14/hour | |
| 45 | 47 | |
| 48 | ## Salary Visualization | |
| 49 | ||
| 50 | See the graph below for a visualization of each job's salary over time, as well | |
| 51 | as percentage increases or decreases between jobs. | |
| 52 | ||
| 53 |  | |
| 54 | ||
| 46 | 55 | This page was inspired by [Xe](https://xeiaso.net/salary-transparency/), and I'm |
| 47 | 56 | quoting the following wording from them as I want to reiterate this piece: |
| 48 | 57 | |
salary_visualization.py added +56
| @@ -0,0 +1,56 @@ | ||
| 1 | # %pip install plotly pandas | |
| 2 | ||
| 3 | import pandas as pd | |
| 4 | import plotly.graph_objs as go | |
| 5 | import locale | |
| 6 | ||
| 7 | locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') | |
| 8 | ||
| 9 | df = pd.read_csv('~/Downloads/salary.csv') | |
| 10 | ||
| 11 | # Reverse the order of the DataFrame | |
| 12 | df = df.iloc[::-1].reset_index(drop=True) | |
| 13 | ||
| 14 | # Calculate the percentage increase | |
| 15 | df['Percentage Increase'] = df['Salary'].pct_change() * 100 | |
| 16 | ||
| 17 | # Initialize the plot | |
| 18 | fig = go.Figure() | |
| 19 | ||
| 20 | # Adding each data point as a separate trace to display the text | |
| 21 | for index, row in df.iterrows(): | |
| 22 | title_company = f"{row['Title']} ({row['Company']})" | |
| 23 | salary_formatted = format_currency(row['Salary']) | |
| 24 | if pd.notna(row['Percentage Increase']): | |
| 25 | text = f"{salary_formatted} ({row['Percentage Increase']:.2f}%)" | |
| 26 | else: | |
| 27 | text = salary_formatted | |
| 28 | fig.add_trace(go.Scatter( | |
| 29 | x=[row['Start'], row['End']], | |
| 30 | y=[row['Salary'], row['Salary']], | |
| 31 | text=[text], | |
| 32 | mode='lines+text', | |
| 33 | name=title_company, # Combine title and company for legend | |
| 34 | textposition='top center' | |
| 35 | )) | |
| 36 | ||
| 37 | fig.update_layout( | |
| 38 | title="Salary Data Over Time (annualized)", | |
| 39 | xaxis_title="Time", | |
| 40 | yaxis_title="Salary", | |
| 41 | font=dict( | |
| 42 | family="monospace", | |
| 43 | size=16 | |
| 44 | ), | |
| 45 | margin=dict(l=50, r=50, t=50, b=100), # Adjust bottom margin for legend space | |
| 46 | legend=dict( | |
| 47 | orientation="h", # Horizontal orientation | |
| 48 | yanchor="top", # Anchor to the top of the legend box | |
| 49 | y=-0.3, # Position below the graph | |
| 50 | xanchor="center", # Center the legend horizontally | |
| 51 | x=0.5 # Center the legend | |
| 52 | ), | |
| 53 | height=800 # Increase vertical size | |
| 54 | ) | |
| 55 | ||
| 56 | fig.show() | |