filter_data

hcrystalball.model_selection.filter_data(df, include_rules=None, exclude_rules=None)[source]

Filter provided dataframe by {column:value} rules.

Parameters
  • df (pandas.DataFrame) – Data to be filtered

  • include_rules (dict) – Rules for what to include. The keys of the dictionaries should be the name of the filtered columns, while the values of the dictionary should be list of values to include.

  • exclude_rules (dict) – Rules for what to include. The keys of the dictionaries should be the name of the filtered columns, while the values of the dictionary should be list of values to exclude.

Returns

Data of the same type / format as the output with the filters applied.

Return type

pandas.DataFrame