dstk.utilities package#

Submodules#

dstk.utilities.dataframe_manipulation module#

dstk.utilities.dataframe_manipulation.get_column(dataframe: DataFrame, column: int | str) list[source]#

Returns the specified column from a dataframe as a list of values.

Parameters:
  • dataframe (DataFrame) – The dataframe where to extract the column.

  • column (int | str) – The index of the column to be extracted or its label. You can only extract by label when the datraframe contains no duplicates. Otherwise, it will raise a ValueError.

Raises:

ValueError – If the provided dataframe contains more than one column with the same name.

dstk.utilities.dataframe_manipulation.get_row(dataframe: DataFrame, row: int | str) list[source]#

Returns the specified row from a dataframe as a list of values.

Parameters:
  • dataframe (DataFrame) – The dataframe where to extract the row.

  • row (int | str) – The index of the row to be extracted or its label. You can only extract by label when the datraframe contains no duplicates. Otherwise, it will raise a ValueError.

Raises:

ValueError – If the provided dataframe contains more than one row with the same name.

Module contents#