Python Developer Salary Survey Results


The survey was conducted over a 1 month period in February 2014 using a simple Google form. The anonymized data was then stored in an SQL Server database. The raw data is publicly accessible via SlashDB API. In this notebook we are doing some simple analysis of the results using (what else) Python. Enjoy.

Access to raw survey data provided by SlashDB

http://demo.slashdb.com/db/pystreet.html

Survey data, HTML representation

Survey data, JSON representation

Data Load

In [1]:
%matplotlib inline
import pandas
import numpy

pandas.options.display.float_format = '${:,.2f}'.format

responses_all = pandas.read_json('http://demo.slashdb.com/db/pystreet/response_usd.json')
responses_usa = pandas.read_json('http://demo.slashdb.com/db/pystreet/response_usd/country/United%20States.json')
In [12]:
responses_usa
Out[12]:
__href ccy country desired_salary desired_salary_usd empl_type response_id salary salary_usd years_experience
0 /db/pystreet/response_usd/response_id/2.json USD United States $60,000.00 $60,000.00 Employee 2 $45,000.00 $45,000.00 0
1 /db/pystreet/response_usd/response_id/3.json USD United States $125,000.00 $125,000.00 Employee 3 $95,000.00 $95,000.00 0
2 /db/pystreet/response_usd/response_id/31.json USD United States $80,000.00 $80,000.00 Employee 31 $65,000.00 $65,000.00 1
3 /db/pystreet/response_usd/response_id/53.json USD United States $125,000.00 $125,000.00 Self-employed 53 $100,000.00 $100,000.00 3
4 /db/pystreet/response_usd/response_id/54.json USD United States $125,000.00 $125,000.00 Employee 54 $110,000.00 $110,000.00 3
5 /db/pystreet/response_usd/response_id/57.json USD United States $75,000.00 $75,000.00 Employee 57 $62,000.00 $62,000.00 3
6 /db/pystreet/response_usd/response_id/168.json USD United States $125,000.00 $125,000.00 Employee 168 $95,000.00 $95,000.00 13
7 /db/pystreet/response_usd/response_id/170.json USD United States $150,000.00 $150,000.00 Employee 170 $100,000.00 $100,000.00 15
8 /db/pystreet/response_usd/response_id/173.json USD United States $91,000.00 $91,000.00 Employee 173 $91,000.00 $91,000.00 15
9 /db/pystreet/response_usd/response_id/174.json USD United States $115,000.00 $115,000.00 Employee 174 $90,000.00 $90,000.00 15
10 /db/pystreet/response_usd/response_id/176.json USD United States $700,000.00 $700,000.00 Employee 176 $600,000.00 $600,000.00 18
11 /db/pystreet/response_usd/response_id/157.json USD United States $250,000.00 $250,000.00 Self-employed 157 $250,000.00 $250,000.00 10
12 /db/pystreet/response_usd/response_id/158.json USD United States $150,000.00 $150,000.00 Employee 158 $120,000.00 $120,000.00 10
13 /db/pystreet/response_usd/response_id/159.json USD United States $40,000.00 $40,000.00 Employee 159 $30,000.00 $30,000.00 10
14 /db/pystreet/response_usd/response_id/162.json USD United States $160,000.00 $160,000.00 Employee 162 $142,000.00 $142,000.00 10
15 /db/pystreet/response_usd/response_id/163.json USD United States $135,000.00 $135,000.00 Self-employed 163 $145,000.00 $145,000.00 11
16 /db/pystreet/response_usd/response_id/164.json USD United States $68,000.00 $68,000.00 Employee 164 $68,000.00 $68,000.00 11
17 /db/pystreet/response_usd/response_id/145.json USD United States $120,000.00 $120,000.00 Employee 145 $71,956.00 $71,956.00 7
18 /db/pystreet/response_usd/response_id/147.json USD United States $100,000.00 $100,000.00 Employee 147 $85,000.00 $85,000.00 7
19 /db/pystreet/response_usd/response_id/148.json USD United States $150,000.00 $150,000.00 Employee 148 $120,000.00 $120,000.00 7
20 /db/pystreet/response_usd/response_id/149.json USD United States $75,000.00 $75,000.00 Employee 149 $68,000.00 $68,000.00 8
22 /db/pystreet/response_usd/response_id/155.json USD United States $150,000.00 $150,000.00 Employee 155 $140,000.00 $140,000.00 9
23 /db/pystreet/response_usd/response_id/129.json USD United States $120,000.00 $120,000.00 Self-employed 129 $70,000.00 $70,000.00 6
24 /db/pystreet/response_usd/response_id/130.json USD United States $130,000.00 $130,000.00 Self-employed 130 $120,000.00 $120,000.00 6
25 /db/pystreet/response_usd/response_id/133.json USD United States $110,000.00 $110,000.00 Employee 133 $96,000.00 $96,000.00 6
26 /db/pystreet/response_usd/response_id/135.json USD United States $120,000.00 $120,000.00 Employee 135 $112,000.00 $112,000.00 6
27 /db/pystreet/response_usd/response_id/142.json USD United States $110,000.00 $110,000.00 Employee 142 $90,000.00 $90,000.00 7
28 /db/pystreet/response_usd/response_id/144.json USD United States $150,000.00 $150,000.00 Employee 144 $125,000.00 $125,000.00 7
29 /db/pystreet/response_usd/response_id/112.json USD United States $175,000.00 $175,000.00 Self-employed 112 $150,000.00 $150,000.00 5
30 /db/pystreet/response_usd/response_id/115.json USD United States $110,000.00 $110,000.00 Self-employed 115 $90,000.00 $90,000.00 5
31 /db/pystreet/response_usd/response_id/116.json USD United States $134,000.00 $134,000.00 Employee 116 $114,000.00 $114,000.00 5
32 /db/pystreet/response_usd/response_id/120.json USD United States $135,000.00 $135,000.00 Employee 120 $123,000.00 $123,000.00 5
33 /db/pystreet/response_usd/response_id/122.json USD United States $58,000.00 $58,000.00 Employee 122 $55,000.00 $55,000.00 5
34 /db/pystreet/response_usd/response_id/124.json USD United States $130,000.00 $130,000.00 Employee 124 $130,000.00 $130,000.00 6
35 /db/pystreet/response_usd/response_id/90.json USD United States $100,000.00 $100,000.00 Employee 90 $75,000.00 $75,000.00 4
36 /db/pystreet/response_usd/response_id/91.json USD United States $55,000.00 $55,000.00 Employee 91 $40,000.00 $40,000.00 4
37 /db/pystreet/response_usd/response_id/96.json USD United States $120,000.00 $120,000.00 Employee 96 $60,000.00 $60,000.00 5
38 /db/pystreet/response_usd/response_id/102.json USD United States $70,000.00 $70,000.00 Employee 102 $50,000.00 $50,000.00 5
39 /db/pystreet/response_usd/response_id/103.json USD United States $150,000.00 $150,000.00 Employee 103 $100,000.00 $100,000.00 5
40 /db/pystreet/response_usd/response_id/109.json USD United States $140,000.00 $140,000.00 Employee 109 $120,000.00 $120,000.00 5
41 /db/pystreet/response_usd/response_id/59.json USD United States $150,000.00 $150,000.00 Self-employed 59 $100,000.00 $100,000.00 3
42 /db/pystreet/response_usd/response_id/64.json USD United States $60,000.00 $60,000.00 Self-employed 64 $30,000.00 $30,000.00 3
43 /db/pystreet/response_usd/response_id/65.json USD United States $85,000.00 $85,000.00 Self-employed 65 $70,000.00 $70,000.00 3
44 /db/pystreet/response_usd/response_id/67.json USD United States $85,000.00 $85,000.00 Employee 67 $85,000.00 $85,000.00 3
45 /db/pystreet/response_usd/response_id/72.json USD United States $97,996.00 $97,996.00 Employee 72 $97,996.00 $97,996.00 3
46 /db/pystreet/response_usd/response_id/74.json USD United States $80,000.00 $80,000.00 Employee 74 $80,000.00 $80,000.00 4

Survey participation by country

In [13]:
by_country = responses_all.groupby('country').size().sort_values()
by_country.plot(kind='barh', figsize=(7,10), fontsize=15)
Out[13]:
<matplotlib.axes._subplots.AxesSubplot at 0x9cf9a90>

Salary Analysis

Remove outliers

Note that there are a few outliers in the raw data, where the annual salary is clearly outside of sensible range. Skip the following cell if you don't want to remove the outliers or modify the cutoff values.

In [5]:
min_salary_cutoff = 500
max_salary_cutoff = 800000
responses_all = responses_all[responses_all['salary_usd'] > min_salary_cutoff]
responses_all = responses_all[responses_all['salary_usd'] < max_salary_cutoff]
responses_usa = responses_usa[responses_usa['salary_usd'] > min_salary_cutoff]
responses_usa = responses_usa[responses_usa['salary_usd'] < max_salary_cutoff]

Salary paid

In [6]:
salary = responses_all["salary_usd"]
salary_usa = responses_usa["salary_usd"]
desired_salary = responses_all["desired_salary_usd"]

d = [{'Min':salary_usa.min(),'Max':salary_usa.max(),'Avg':salary_usa.mean(),'Median':salary_usa.median()},
 {'Min':salary.min(),'Max':salary.max(),'Avg':salary.mean(),'Median':salary.median()}]
df = pandas.DataFrame.from_records(d)
df = df[['Min','Max','Avg','Median']]
df.index = ['USA','Worldwide',]
df
Out[6]:
Min Max Avg Median
USA $30,000.00 $600,000.00 $105,998.96 $95,000.00
Worldwide $1,443.30 $600,000.00 $63,817.37 $50,000.00

Salary desired

In [7]:
desired_salary = responses_all["desired_salary_usd"]
desired_salary_usa = responses_usa["desired_salary_usd"]

d = [{'Min':desired_salary_usa.min(),'Max':desired_salary_usa.max(),'Avg':desired_salary_usa.mean(),'Median':desired_salary_usa.median()},
 {'Min':desired_salary.min(),'Max':desired_salary.max(),'Avg':desired_salary.mean(),'Median':desired_salary.median()}]
df = pandas.DataFrame.from_records(d)
df = df[['Min','Max','Avg','Median']]
df.index = ['USA','Worldwide',]
df
Out[7]:
Min Max Avg Median
USA $40,000.00 $700,000.00 $127,043.39 $120,000.00
Worldwide $1,900.00 $700,000.00 $84,593.24 $69,444.44

USA Salary Breakdown

In [8]:
plot = responses_usa.hist(column=['salary_usd','desired_salary_usd'], bins=[0, 25000,50000,75000,100000,125000,150000,175000,200000,225000,250000,275000,300000,325000,350000,375000,400000,425000,450000,475000,500000], figsize=(20,5), xrot=45, xlabelsize=15)

Worldwide Salary Breakdown

In [9]:
plot = responses_all.hist(column=['salary_usd','desired_salary_usd'], bins=[0, 25000,50000,75000,100000,125000,150000,175000,200000,225000,250000,275000,300000,325000,350000,375000,400000,425000,450000,475000,500000], figsize=(20,5), xrot=45, xlabelsize=15, ylabelsize=15)

How much more Python developers would like to earn?

In [10]:
x = responses_all[['salary_usd','desired_salary_usd']].mean()
# x.plot(kind='barh')
plot = x.plot(kind="bar", figsize=(7,7), fontsize=15, title="Average salary and average desired salary worldwide")
print("At a maximum {0:.0%}".format(((responses_all['desired_salary_usd'] - responses_all['salary_usd'])/responses_all['salary_usd'] ).max()))
print("On average {0:.0%}".format(((responses_all['desired_salary_usd'] - responses_all['salary_usd'])/responses_all['salary_usd'] ).mean()))
print("At a minimum {0:.0%}".format(((responses_all['desired_salary_usd'] - responses_all['salary_usd'])/responses_all['salary_usd'] ).min()))
At a maximum 317%
On average 46%
At a minimum -7%

Salary as a function of years of experience

In [11]:
from numpy import max, min
df = responses_usa[['years_experience','salary_usd']]
g = df.groupby('years_experience')
df = g.agg([min, max])
df.plot(kind="line", figsize=(12,7), title="U.S. Python developer salary range as a function of experience.")

df = responses_all[['years_experience','salary_usd']]
g = df.groupby('years_experience')
df = g.agg([min, max])
df.plot(kind="line", figsize=(12,7), title="Worldwide Python developer salary range as a function of experience.")
Out[11]:
<matplotlib.axes._subplots.AxesSubplot at 0xa462be0>

About Us

  • Pystreet is a up and coming online community of professional Python developers. We are currently in pre-launch mode at http://pystreet.com

  • SlashDB is a new kind of middleware, which instantly creates REST APIs to SQL databases so their content becomes instantly accessible to authorized web, mobile and enterpise applications and end-users, under standard data formats for reading and writing. http://www.slashdb.com/

  • vt.enterprise is a technology consultancy, co-sourcing and software development firm located in Jersey City, NJ. We are hiring: http://vtenterprise.com/career.html