get_value_counts
Analyze frequency distribution of column values to understand categorical data patterns, identify common values, and assess data quality with configurable counts or percentages.
Instructions
Get frequency distribution of values in a column.
Analyzes the distribution of values in a specified column, providing counts and optionally percentages for each unique value. Essential for understanding categorical data and identifying common patterns.
Returns: Frequency distribution with counts/percentages for each unique value
Analysis Features: š¢ Frequency Counts: Raw counts for each unique value š Percentage Mode: Normalized frequencies as percentages šÆ Top Values: Configurable limit for most frequent values š Summary Stats: Total values, unique count, distribution insights
Examples: # Basic value counts counts = await get_value_counts(ctx, "category")
AI Workflow Integration: 1. Categorical data analysis and encoding decisions 2. Data quality assessment (identifying rare values) 3. Understanding distribution for sampling strategies 4. Feature engineering insights for categorical variables
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| column | Yes | Name of the column to analyze value distribution | |
| normalize | Yes | Return percentages instead of raw counts | |
| sort | Yes | Sort results by frequency | |
| ascending | Yes | Sort in ascending order (False = descending) | |
| top_n | Yes | Maximum number of values to return (None = all values) |