value_counts
Analyze Excel columns by calculating frequency counts or proportions for each value, optionally limited to top N and excluding nulls.
Instructions
Return frequency counts for a column as counts or normalized proportions.
Args: file_path: Workbook path. sheet_name: Worksheet name. column: Column name to analyse. normalize: If True return proportions instead of raw counts. top_n: If provided, return only the top N values. dropna: Exclude nulls when True. has_header: Whether the sheet has a header row.
Returns: dict: {"column", "total_rows", "normalize", "counts": [{"value", "count"}, ...]}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | ||
| column | Yes | ||
| dropna | No | ||
| file_path | Yes | ||
| normalize | No | ||
| has_header | No | ||
| sheet_name | Yes |