pydit.wrangling.countsΒΆ
Module that implements a few useful count related functions Takes inspiration on the usual counta and countif functions in Excel
Add a column counting occurrence of values in a given column. Useful for sorting/grouping by frequency
Add a cumulative count of unique keys in a given column
Add a column counting the number of null values in a row
Add a column counting the number of non-null values in a row
Add a column checking if the values in a row are different
Add a column counting related keys in another dataframe (e.g., countif)
Functions
Generates a running total of cumulative unique values in a given column. |
|
Returns the number of null values in the columns specified in cols :param df: Dataframe to be analyzed :type df: pd.DataFrame :param cols: List of columns to be analyzed :type cols: list |
|
Returns the number of non-null values in the columns specified in cols :param df: Dataframe to be analyzed :type df: pd.DataFrame :param cols: List of columns to be analyzed :type cols: list |
|
Adds column in each df counting occurences of each key in the other dataframe |
|
Generates a column counting occurrence of values in a given column. |
|
Returns True if the values in the columns specified in cols are different :param df: Dataframe to be analyzed :type df: pd.DataFrame :param cols: List of columns to be analyzed :type cols: list |