col_to_front

hhpy.ds.col_to_front(df: pandas.core.frame.DataFrame, cols: Union[Sequence[Union[int, float, str, bytes, None]], int, float, str, bytes, None], inplace: bool = False) → pandas.core.frame.DataFrame[source]

Brings one or more columns to the front (first n positions) of a DataFrame

Parameters:
  • df – Pandas DataFrame containing the data, other objects are implicitly cast to DataFrame
  • cols – One or more column names to be brought to the front
  • inplace – Whether to modify the DataFrame inplace [optional]
Returns:

Modified copy of the DataFrame