IndexSetter#

class polpo.preprocessing.pd.IndexSetter(key, inplace=True, drop=False, verify_integrity=True)[source]#

Bases: PreprocessingStep

Set the DataFrame index using existing columns.

Check out https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.set_index.html.

Parameters:
  • key (str) – New index.

  • inplace (bool) – Whether to perform operation in place.

  • drop (bool) – Delete columns to be used as the new index.

  • verify_integrity (bool) – Check the new index for duplicates.

apply(df)[source]#

Apply step.

Parameters:

df (pandas.DataFrame) – Dataframe.