Created
August 2, 2020 18:13
-
-
Save rchardptrsn/766e18c6725b0eec98f05ae4897bf937 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Convert the Date column back to string, | |
| # find January 1st 2020, | |
| # only keep State and percent unemployed columns | |
| # Set index to State | |
| jan_emp = df[df['Date'].dt.strftime(date_format='%Y-%m-%d').str.contains('2020-01-01')][['State','Pct_Unemployed']].set_index('State') | |
| # Convert the Date column back to string, | |
| # find June 1st 2020, | |
| # only keep State and percent unemployed columns | |
| # Set index to State | |
| june_emp = df[df['Date'].dt.strftime(date_format='%Y-%m-%d').str.contains('2020-06-01')][['State','Pct_Unemployed']].set_index('State') | |
| # Subtract the January data from the June Data | |
| chg_emp = june_emp.subtract(jan_emp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment