bach.DataFrame.set_index

set_indexโ€‹

(keys, drop=True, append=False)

โ€‹[source]

Set this dataframeโ€™s index to the the index given in keys

Parametersโ€‹

  • keys (Union[str, Series, Sequence[Union[str, Series]]]) โ€“ the keys of the new index. Can be a column name str, a Series, or a list of those. If Series are passed, they should have the same base node as the DataFrame they are set on.
  • drop (bool) โ€“ delete columns to be used as the new index.
  • append (bool) โ€“ whether to append to the existing index or replace.

Returnsโ€‹

a DataFrame with the new index.

Return typeโ€‹

DataFrame