str_join_cols#

caf.toolkit.pandas_utils.df_handling.str_join_cols(df, columns, separator='_')[source]#

Equivalent to separator.join(columns) for all rows of pandas DataFrame.

Joins the given columns together using separator. Returns a pandas Series with the return value in.

Parameters:
  • df (DataFrame) – The dataframe containing the columns to join

  • columns (list[str]) – The columns in df to concatenate together

  • separator (str) – The separator to use when joining columns together.

Returns:

a Pandas.Series containing all columns joined together using separator

Return type:

joined_column