Skip to main content
Glama

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")

# Get percentages for top 10 values counts = await get_value_counts(ctx, "status", normalize=True, top_n=10) # Sort in ascending order counts = await get_value_counts(ctx, "grade", ascending=True)

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

TableJSON Schema
NameRequiredDescriptionDefault
columnYesName of the column to analyze value distribution
normalizeYesReturn percentages instead of raw counts
sortYesSort results by frequency
ascendingYesSort in ascending order (False = descending)
top_nYesMaximum number of values to return (None = all values)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jonpspri/databeak'

If you have feedback or need assistance with the MCP directory API, please join our Discord server