Article directory
一,value_counts()
(1) Usage
value_counts() is a summary calculation for different values in the data of a certain column.
Example
data['dishes_name'].value_counts()
Perform summary calculations for dishes_name, and calculate the values of different dishes in this column
(2) Parameter introduction
pd.value_counts(
values,
sort=True,
ascending=False,
normalize=False,
bins=None,
dropna=True,
)
parameter | introduce |
---|---|
sort | Optional True or False, the default is to sort |
ascending | Optional True or False, default descending order |
normalize | Optional True or False, whether to standardize |
bins | Whether to partition intervals, the default is not partitioned |
dropsy | Optional True or False, missing value processing |
Two, count()
count() is to sum up a column to get the total number of data
data['dishes_name'].count()
It means that there are 10037 pieces of data in my column