Skip to content

Instantly share code, notes, and snippets.

@abhishek-shrm
Created April 21, 2020 12:46
Show Gist options
  • Save abhishek-shrm/7594c2dea3dbf95816695a7808de9009 to your computer and use it in GitHub Desktop.
Save abhishek-shrm/7594c2dea3dbf95816695a7808de9009 to your computer and use it in GitHub Desktop.
# Coloring states and UTs with active COVID-19 cases
df_covid['color']=pd.cut(df_covid['Active Cases'],bins,labels=['#FFEBEB','#F8D2D4','#F2B9BE','#EBA1A8','#E58892','#DE6F7C','#D85766','#D13E50','#CB253A','#C50D24'],include_lowest=False)
# Coloring states and UTs with no active cases but previously had
df_covid['color'].replace(np.nan,'#32CD32',inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment