📖 INDEX
LOADING ENGINE...
df.value_counts()
AI & DATA SCIENCE // df-value-counts
Return a Series containing counts of unique rows in the DataFrame.
Syntax
counts = df['A'].value_counts()Examples
Example 01Basic Usage
counts = df['A'].value_counts()Best Practices
- Use vectorized operations over iterations (e.g.
iterrows()) for performance. - Always verify memory usage when loading large files.