Frequency Tables
The frequency table (Shift+F) is VisiData's most powerful single-keystroke feature. It groups rows by the current column's value and counts occurrences — instantly, even on millions of rows.
Learning Focus
Internalize the workflow: move cursor to a column → press Shift+F → read the frequency distribution → press Enter to drill into a group → press q to return.
Opening a Frequency Table
# Move cursor to any column
Shift+F # open frequency table for current column
# Multi-column frequency (all key columns)
gF # frequency table grouped by ALL key columns
The frequency table shows:
value count percent histogram
webserver 12 40.0% ████████████████
database 8 26.7% ██████████
cache 6 20.0% ████████
monitoring 4 13.3% ██████
Navigating the Frequency Table
Inside the frequency table:
| Key | Action |
|---|---|
Enter | Open a filtered sheet of the source rows in this group |
gEnter | Open a filtered sheet for ALL selected groups |
s | Select this group (highlights source rows) |
u | Unselect this group |
[ / ] | Sort by count ascending / descending |
q | Return to source sheet |
Setting Aggregators
Aggregators compute statistics on other columns within each frequency group.
+ aggregator add aggregator to current column
z+ aggregator compute aggregator result for current/selected rows (store in Memory Sheet)
Available aggregators:
| Name | Computes |
|---|---|
sum | Total sum |
mean | Arithmetic mean |
median | Median value |
min | Minimum value |
max | Maximum value |
stdev | Standard deviation |
count | Count of non-null values |
distinct | Count of distinct values |
list | All values as a list |
most_common | Most frequently occurring value |
Example — frequency table of roles with average salary:
vd /tmp/employees.csv
# Move to 'salary' column, cast to float: %
# Press + and enter: mean
# Move to 'role' column
Shift+F
# Frequency table now shows: role, count, percent, mean_salary
One-Line Summary
zF open a one-line summary for all rows and selected rows
The summary shows aggregate stats for every column: count, distinct, min, max, mean, stdev.
Drilling Into Groups
Practical Use Cases
Analyze HTTP Status Code Distribution
vd /var/log/nginx/access.log
# Move to 'status' column (or the 9th field)
Shift+F
# Instantly see how many 200, 301, 404, 500 responses
# Press Enter on '500' to drill into all 500 errors
Count Servers by Role and Region
vd /tmp/servers.csv
# Mark 'role' as key column: move to it, press !
# Mark 'region' as key column: move to it, press !
# Open multi-column frequency table
gF
# Groups by role + region combinations
Find Most Common User Agents
vd /var/log/nginx/access.log
# Move to 'user_agent' column
Shift+F
# See top user agents by frequency
# Press ] to sort by count descending
Quick Column Statistics
vd /var/www/html/exports/orders.csv
# Move to 'amount' column, cast to float: %
# Press z+ and enter: mean → stores mean in Memory Sheet
# Press z+ and enter: max → stores max in Memory Sheet
# Press Alt+Shift+M to open Memory Sheet and view results
Troubleshooting Matrix
| Problem | Cause | Fix |
|---|---|---|
| Frequency table shows one group | Column has unique values per row | Wrong column — try a categorical column |
| Aggregator shows wrong result | Column is wrong type | Cast column to # or % first |
Enter opens empty sheet | No rows matched in source | Source sheet was filtered — check with g" |
| Frequency table slow | Very large dataset, many distinct values | Use --max-rows to sample |
Best Practices
- Use
zF(one-line summary) for a quick data quality overview of every column at once. - Set aggregators before opening the frequency table for richer grouped summaries.
- Press
]inside the frequency table to sort by count descending and immediately see the most common values.
Hands-On Practice
cat > /tmp/employees.csv << 'EOF'
name,role,region,salary
Alice,engineer,sg,85000
Bob,manager,kl,92000
Carol,engineer,sg,78000
Dave,manager,sg,95000
Eve,engineer,jk,72000
Frank,analyst,kl,65000
Grace,engineer,jk,70000
EOF
vd /tmp/employees.csv
# 1. Move to 'salary' column, press % → cast to float
# 2. Press + → enter: mean
# 3. Move to 'role' column
# 4. Press Shift+F → see frequency + mean salary per role
# 5. Press ] → sort by count descending
# 6. Press Enter on 'engineer' → see filtered engineer sheet
# 7. Press q → return to frequency table
# 8. Press q → return to source