Skip to content

Instantly share code, notes, and snippets.

View thomascamminady's full-sized avatar

thomas thomascamminady

View GitHub Profile
{
"config": {
"text": {
"color": "gray",
"fontSize": 14
},
"title": {
"anchor": "middle",
"fontWeight": "normal",
"titleFontWeight": "normal",
```
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"background": "white",
"padding": 5,
"width": 480,
"data": [
{
"name": "brush_store"
},
year day color count
2015 25 gold 6695
2015 25 silver 2534
2015 24 gold 7727
2015 24 silver 105
2015 23 gold 8999
2015 23 silver 44
2015 22 gold 7378
2015 22 silver 199
2015 21 gold 9662
# %%
import numpy as np
import matplotlib.pyplot as plt
from cycler import cycler
import matplotlib.patheffects as path_effects
# %%
np.random.seed(1)
n, m = 200, 6
x = np.arange(n)
@thomascamminady
thomascamminady / drop_columns_that_are_all_null.py
Created September 20, 2023 07:40
Polars drop columns that are all null
import polars as pl
def drop_columns_that_are_all_null(_df: pl.DataFrame) -> pl.DataFrame:
return _df[[s.name for s in _df if not (s.null_count() == _df.height)]]
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"background": "white",
"padding": 5,
"title": {"anchor": "middle", "text": "World Record Progression"},
"data": [
{"name": "param_13_store"},
{"name": "param_14_store"},
{
"name": "data-f0a84751744be4555114288140dc4b49",
@thomascamminady
thomascamminady / json
Created June 6, 2023 12:21
World Record Data
{
"date of event": {
"0": -38275200000,
"1": 84240000000,
"2": 203472000000,
"3": 207100800000,
"4": 236563200000,
"5": 423878400000,
"6": 426038400000,
"7": 461980800000,
@thomascamminady
thomascamminady / csv
Created June 6, 2023 12:19
World Records
,date of event,percent of wr,event,sex,name,rank
0,1968-10-15,105.62440419447093,100 metres,Female,Wyomia Tyus,2501
1,1972-09-02,105.52907530981888,100 metres,Female,Renate Stecher,2293
2,1976-06-13,105.24308865586272,100 metres,Female,Ingeborg Helten,1774
3,1976-07-25,104.95710200190658,100 metres,Female,Annegret Richter,1362
4,1977-07-01,103.71782650142993,100 metres,Female,Marlies Göhr,338
5,1983-06-08,103.05052430886559,100 metres,Female,Marlies Göhr,130
6,1983-07-03,102.85986653956148,100 metres,Female,Evelyn Ashford,104
7,1984-08-22,102.57387988560534,100 metres,Female,Evelyn Ashford,67
8,1988-07-16,100.0,100 metres,Female,Florence Griffith-Joyner,1
@thomascamminady
thomascamminady / json
Created June 6, 2023 12:16
World Records
{
"config": {
"text": {
"color": "gray",
"fontSize": 14
},
"title": {
"anchor": "middle",
"fontWeight": "normal",
"titleFontWeight": "normal",
@thomascamminady
thomascamminady / data.csv
Created August 28, 2022 12:24
Energy Efficiency across Programming Languages. Source: https://greenlab.di.uminho.pt/wp-content/uploads/2017/09/paperSLE.pdf
language label time energy mb mb_normalized_by_c
0 C (c) 1.0 1.0 1.17 1.0
1 Rust (c) 1.04 1.03 1.54 1.316
2 C++ (c) 1.56 1.34 1.34 1.145
3 Ada (c) 1.85 1.7 1.47 1.256
4 Java (v) 1.89 1.98 6.01 5.137
5 Chapel (c) 2.14 2.18 4.0 3.419
6 Go (c) 2.83 3.23 1.05 0.897
7 Pascal (c) 3.02 2.14 1.0 0.855
8 Ocaml (c) 3.09 2.4 2.82 2.41