Skip to main content

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% ██████

Inside the frequency table:

KeyAction
EnterOpen a filtered sheet of the source rows in this group
gEnterOpen a filtered sheet for ALL selected groups
sSelect this group (highlights source rows)
uUnselect this group
[ / ]Sort by count ascending / descending
qReturn 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:

NameComputes
sumTotal sum
meanArithmetic mean
medianMedian value
minMinimum value
maxMaximum value
stdevStandard deviation
countCount of non-null values
distinctCount of distinct values
listAll values as a list
most_commonMost 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

ProblemCauseFix
Frequency table shows one groupColumn has unique values per rowWrong column — try a categorical column
Aggregator shows wrong resultColumn is wrong typeCast column to # or % first
Enter opens empty sheetNo rows matched in sourceSource sheet was filtered — check with g"
Frequency table slowVery large dataset, many distinct valuesUse --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

What's Next