I hereby claim:
- I am jamesdunham on github.
- I am jdunham (https://keybase.io/jdunham) on keybase.
- I have a public key ASBfo4fghAbkFJnfASnep_tSPk_gKGjT1Gx-PnY8SxgcfQo
To claim this, I am signing this object:
library(testthat) | |
devtools::load_all() | |
names_to_levels = function(item_names, gt_names) { | |
vapply(item_names, function(item_name) { | |
sum(grepl(paste0('^', item_name, '_gt[0-9]+$'), gt_names)) | |
}, integer(1)) | |
} | |
test_that('names_to_levels recovers number of choices per item given item names', { | |
expect_equal(names_to_levels('abortion', 'abortion_gt1'), c('abortion' = 1)) |
I hereby claim:
To claim this, I am signing this object:
from io import StringIO | |
import psycopg2 | |
from tqdm import tqdm | |
def copy_from(df: pd.DataFrame, | |
table: str, | |
connection: psycopg2.extensions.connection, | |
chunk_size: int = 10000): |