rstoolbox.utils.add_column

rstoolbox.utils.add_column(df, name, value)

Adds a new column to the DataFrame with the given value.

Parameters:
  • df (DataFrame) – Data container.
  • name (str) – Name of the new column
  • value – Value that will be given to all rows of the new column (any type)
Returns:

DataFrame - The data container with the new column