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
| # you will need https://github.com/cdcgov/cfa-catalog-pub installed | |
| from cfa.dataops import datacat | |
| import polars.selectors as cs | |
| # View all the available data | |
| datacat.__namespace_list__ | |
| # This is the wednesday nhsn data | |
| datacat.public.stf.nhsn_hrd_prelim.load.get_versions() | |
| # You can load a particular version like this |
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
| from jax import random, jit | |
| import jax.numpy as jnp | |
| from jax.scipy import stats | |
| from util import ravelize_function, make_log_density | |
| __all__ = ["log_density", "log_density_vec", "init_draw_zero"] | |
| def constrain_parameters(sigma_unc, alpha, beta): |
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
| import polars as pl | |
| # Making data frames ------------------------------------------ | |
| # with dictionary | |
| df = pl.DataFrame({ | |
| 'name': ['foo', 'bar', 'baz'], | |
| 'bar': [0, 1, 2], | |
| 'qux': [0.0, 1.0, 2.0] | |
| }) |
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
| #Author: Cameron Davidson-Pilon, replicated styles from FiveThirtyEight.com | |
| # See https://www.dataorigami.net/blogs/fivethirtyeight-mpl | |
| # Modified by Nathan McIntosh to my personal tastes | |
| # Text is all very large, ideal for use in presentations | |
| lines.linewidth: 4 | |
| lines.solid_capstyle: butt | |
| legend.fancybox: true |
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
| # set number of cores to use fitting the model | |
| # no benefit on runtime if cores > chains which is set to 4 by default | |
| options(mc.cores = 4) | |
| # Packages ---------------------------------------------------------------- | |
| # install.packages(c("data.table", "remotes", "ggplot2")) | |
| # remotes::install_github("epiforecasts/EpiNow2") | |
| # remotes::install_github("epiforecasts/covidregionaldata") | |
| library(data.table) | |
| library(ggplot2) |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
- There are always 24 hours in a day.
- February is always 28 days long.
- Any 24-hour period will always begin and end in the same day (or week, or month).
NewerOlder
