pdstools.utils.streamlit_utils

Functions

cached_sample()

cached_datamart(**kwargs)

import_datamart(extract_pyname_keys)

from_uploaded_file(extract_pyname_keys, codespaces)

from_file_path(extract_pyname_keys, codespaces)

model_selection_df(df, context_keys)

filter_dataframe(→ polars.LazyFrame)

Adds a UI on top of a dataframe to let viewers filter columns

model_and_row_counts(df)

Returns unique model id count and row count from a dataframe

configure_predictor_categorization()

convert_df(df)

st_get_latest_pdstools_version()

Module Contents

cached_sample()
cached_datamart(**kwargs)
import_datamart(extract_pyname_keys: bool)
Parameters:

extract_pyname_keys (bool)

from_uploaded_file(extract_pyname_keys, codespaces)
from_file_path(extract_pyname_keys, codespaces)
model_selection_df(df: polars.LazyFrame, context_keys: list)
Parameters:
  • df (polars.LazyFrame)

  • context_keys (list)

filter_dataframe(df: polars.LazyFrame, schema: dict | None = None, queries=[]) polars.LazyFrame

Adds a UI on top of a dataframe to let viewers filter columns

Parameters:
  • df (pl.DataFrame) – Original dataframe

  • schema (Optional[dict])

Returns:

The filtered LazyFrame

Return type:

pl.LazyFrame

model_and_row_counts(df: pdstools.utils.types.ANY_FRAME)

Returns unique model id count and row count from a dataframe

Parameters:

df (Union[pl.DataFrame, pl.LazyFrame]) – The input dataframe

Returns:

unique model count row count

Return type:

Tuple[int, int]

configure_predictor_categorization()
convert_df(df)
st_get_latest_pdstools_version()