Skip to content

Instantly share code, notes, and snippets.

@michaelaye
Created May 13, 2020 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save michaelaye/48f5a76fc29fe0e414b90e5040927ab8 to your computer and use it in GitHub Desktop.
Save michaelaye/48f5a76fc29fe0e414b90e5040927ab8 to your computer and use it in GitHub Desktop.
def plot_loglog(self, country, freq="2d"):
newdf = self.get_country(country)
return (
newdf.resample(freq)
.mean()
.hvplot.scatter(
x="Infections",
y="Rate",
logy=True,
logx=True,
ylim=(1, None),
xlim=(1, None),
label=country,
)
)
def plot_loglog_countries(self, countries):
if len(countries) == 1:
return self.plot_loglog(countries[0])
else:
return self.plot_loglog(countries[0]) * self.plot_loglog_countries(
countries[1:]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment