Created
June 2, 2020 09:05
-
-
Save rohitrajiit/26440fb3c4b833feca63ca68409f335e 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
data = data.sort_values(by=['state', 'Dates']) | |
data['dailypositive'] = data['positive'].diff() | |
data['dailytested'] = data['totaltested'].diff() | |
data.loc[data['state']!=data['state'].shift(1), 'dailytested'] = data['totaltested'] | |
data.loc[data['state']!=data['state'].shift(1), 'dailypositive'] = data['positive'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment