valueCounts
Returns a DataFrame containing the counts of the unique values in a DataFrame or DataColumn.
See column selectors for how to select the columns for this operation.
Parameters:
sort: Boolean = true— whether to sort by countascending: Boolean = false— sort direction (by default most frequent first)dropNA: Boolean = true— whether to excludeNAvalues from counting (excluded by default)resultColumn: String = "count"— name of the column with countscolumns = all— columns to use when counting unique combinations
The following dataframe will be used in the examples below:
For a DataFrame, dropNA = true (default) excludes the entire row if any selected column contains an NA value. NA values in columns that are not selected do not affect the result.
To include rows with NA values, set dropNA = false:
You can specify columns that will be used to determine uniqueness:
This operation can also be applied to a DataColumn: