Skip to content

Instantly share code, notes, and snippets.

# 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
@toxicdeep
toxicdeep / polars.md
Created December 22, 2024 09:36 — forked from bitsnaps/polars.md
A cheat sheet for polars python package

Polars Cheat Sheet

Here's a cheat sheet for the Polars Python package, covering many of its key functions and features:

Installation

pip install polars 

# Install Polars with all optional dependencies:
pip install 'polars[all]'
@WardBrian
WardBrian / linear_regression.py
Last active November 5, 2025 17:16
functional-style jax models (take 2)
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):
@swo
swo / polars_cheat_sheet.py
Last active December 6, 2023 03:24
Polars cheat sheet
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]
})
@veekaybee
veekaybee / normcore-llm.md
Last active January 30, 2026 20:11
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@rain-1
rain-1 / LLM.md
Last active January 30, 2026 14:32
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@natemcintosh
natemcintosh / style.mplstyle
Last active January 18, 2024 20:49
Presets I like for matplotlib. Basically the FiveThirtyEight style with a few modifications.
#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
@seabbs
seabbs / forecast-covid-deaths-from-covid-cases.R
Last active November 14, 2023 18:28
Example of using EpiNow2 to forecast Covid-19 deaths from Covid-19 cases (both observed and forecast) for a country in the ECDC dataset. See the documentation for more details: https://epiforecasts.io/EpiNow2/dev/
# 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)
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active February 2, 2026 02:35
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

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.

Falsehoods

  • 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).