pydit.wrangling.counts.count_cumulative_unique¶
- pydit.wrangling.counts.count_cumulative_unique(df, column_name, dest_column_name, case_sensitive=True)[source]¶
Generates a running total of cumulative unique values in a given column.
- Parameters:
df (pd.DataFrame) – Dataframe to be analyzed
column_name (Hashable) – Name of the column containing values from which a running count of unique values will be created.
dest_column_name (str) – Name of the column to be created containing the cumulative count of unique values.
case_sensitive (bool, optional, default True) – Whether or not uppercase and lowercase letters will be considered equal (e.g., ‘A’ != ‘a’ if True).
- Returns:
Dataframe with a new column containing the cumulative count of unique values in the given column.
- Return type:
pd.DataFrame