stouputils.collections package#

This module provides utilities for collection manipulation:

  • unique_list() - Remove duplicates from a list while preserving order using object id, hash or str

  • at_least_n() - Check if at least n elements in an iterable satisfy a given predicate

  • sort_dict_keys() - Sort dictionary keys using a given order list (ascending or descending)

  • upsert_in_dataframe() - Insert or update a row in a Polars DataFrame based on primary keys

  • array_to_disk() - Easily handle large numpy arrays on disk using zarr for efficient storage and access.

stouputils collections examples

Submodules#