valueCounts
Return DataFrame
containing counts of unique values in DataFrame
or DataColumn
.
valueCounts(sort = true, ascending = false, dropNA = false)
[ { columns } ]
Parameters:
sort: Boolean = true
— sort by countascending: Boolean = false
— sort in ascending orderdropNA: Boolean = true
— don't include counts ofNA
valuecolumns = all
— columns to use when counting unique combinations
df.city.valueCounts()
df.valueCounts { name and city }
Last modified: 27 September 2024