ibis-extensions is a utility library that helps implementing higher-level code snippets for ibis.
ibis-extensions is published to the Python Package Index (PyPI) under the name snowbear. To install it, run:
pip install ibis-extensionsPivots table based on column values
result = table.pivotpivot(table, table.id, table.type, table.value, aggregation_function="mean")Convert categorical variables into indicator variables.
get_dummies(table, table.category)Drop duplicate rows from table.
dedup(table, keys=[table.id])to dedup by all columns, call dedup without keys
dedup(table)merge overlapping timeframes
merge_timeframes(table, table.start, table.end, keys=[table.id])cut and filter timeframes in a provided range so not timeframe will be after end_limit or before start_limit.
cut_timeframes(table, table.start, table.end, start_limit=date(2020, 4, 1), end_limit=date(2020, 8, 1))you may provide a seperate range for each row by providing limit columns cut_timeframes(table, table.start, table.end, table.start_limit, table.end_limit)