neuralib.util.dataframe.helper_with_index_column
- neuralib.util.dataframe.helper_with_index_column(df, column, index, maintain_order=False, strict=False)[source]
A help function to do the filter on an index column.
- Parameters:
df (T)
column (str) – index column
index (int | list[int] | ndarray | T) – index array
maintain_order (bool) – keep the ordering of index in the returned dataframe.
strict (bool) – all index in index should present in the returned dataframe. Otherwise, an error will be raised.
- Returns:
- Raises:
RuntimeError – strict mode fail.
- Return type:
T