-
-
Save abkosar/e44f988df72c23532685d23531e92d29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs_data_science.location = jobs_data_science.location.str.replace('Nyc.*' , 'New York, NY') | |
jobs_data_science.location = jobs_data_science.location.str.replace('Ny.*' , 'New York, NY') | |
jobs_data_science.location = jobs_data_science.location.str.replace('New York City.*' , 'New York, NY') | |
jobs_data_science.location = jobs_data_science.location.str.replace('Brooklyn.*' , 'New York, NY') | |
jobs_data_science.location = jobs_data_science.location.str.replace('Bronx.*' , 'New York, NY') | |
jobs_data_science.location = jobs_data_science.location.str.replace('Manhattan.*' , 'New York, NY') | |
jobs_data_science.location = jobs_data_science.location.str.replace('New York Relocating.*' , 'New York, NY') | |
jobs_data_science[jobs_data_science.location.str.contains("New York")==True] | |
jobs_data_science = jobs_data_science[jobs_data_science.location.str.contains("ion")==False] | |
jobs_data_science = jobs_data_science[jobs_data_science.state.str.contains("j")==False] | |
jobs_data_science = jobs_data_science[jobs_data_science.state.str.contains("TX")==False] | |
job_count_by_location = jobs_data_science.groupby(['state', 'location'])['job_title'].agg('count') | |
job_count_by_location = pd.DataFrame(job_count_by_location) | |
job_count_by_location.columns = ['Job_Count'] | |
job_count_by_location | |
job_count_by_location.Job_Count[job_count_by_location.Job_Count > 10].plot( | |
kind = 'bar', legend = True, | |
figsize = (12,6), | |
color = "salmon") | |
locs, labels = plt.xticks() | |
plt.setp(labels, rotation=0) | |
plt.xlabel("Location", fontsize = 15) | |
plt.ylabel("Job Count", fontsize = 15) | |
plt.title("Number of Jobs by Location", fontsize = 25) | |
plt.savefig('job_count_by_location.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment