macpie.pandas.filter_by_id#
- macpie.pandas.filter_by_id(df: DataFrame, id_col_name: str, ids: List[int]) DataFrame #
Filters a
pandas.DataFrame
object to only include a specified list of numerical IDs in a specified numerical ID column.- Parameters:
- dfDataFrame
To be filtered
- id_col_namestr
The DataFrame column to filter on
- ids: list
The list of IDs to filter on in the
id_col_name
column
- Returns:
- DataFrame
A DataFrame of the filtered result.