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. Think of it as a one-key GROUP BY.

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.

Sample Data Used in This Lesson

cat > ~/github/practice-folder/visidata/01-loading/01-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 ~/github/practice-folder/visidata/01-loading/01-employees.csv

Inside VisiData:

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

Open a Frequency Table on a Column

Move cursor to the role column, press Shift+F.

# Move cursor to 'role' column
Shift+F

Frequency table appears:

role count percent histogram
engineer 4 57.1% ████████████████
manager 2 28.6% ████████
analyst 1 14.3% ████

This immediately tells you: 4 engineers, 2 managers, 1 analyst — all from a single keypress.


Sort by Count

Inside the frequency table, press ] to sort by count descending (most common first):

# Inside frequency table:
]

Result:

role count percent histogram
engineer 4 57.1% ████████████████ ← most common
manager 2 28.6% ████████
analyst 1 14.3% ████ ← least common

Press [ to sort ascending (least common first).


Drill Into a Group

Press Enter on any frequency table row to open a filtered sheet of just those rows.

# Move cursor to 'engineer' row in the frequency table
Enter

New sheet opens — only the engineer rows:

name role region salary
Alice engineer sg 85000
Carol engineer sg 78000
Eve engineer jk 72000
Grace engineer jk 70000

Press q to close and return to the frequency table. Press q again to return to the source.


Add an Aggregator (Mean Salary per Role)

Aggregators add statistics to your frequency table. Set them before pressing Shift+F.

# Move cursor to 'salary' column
% # cast to float (required for numeric aggregation)
+
# Enter: mean
# 'salary' now shows mean in the frequency table

# Now move to 'role' column
Shift+F

Frequency table now shows role, count, percent and mean salary:

role count percent mean_salary
engineer 4 57.1% 76250.0
manager 2 28.6% 93500.0
analyst 1 14.3% 65000.0

Multiple Aggregators

# Move to 'salary' column
+
# Enter: min

# Move to 'salary' column again (or it's still selected)
+
# Enter: max

# Move to 'role' column
Shift+F

Result:

role count min_salary max_salary
engineer 4 70000 85000
manager 2 92000 95000
analyst 1 65000 65000

Drill Into Multiple Groups at Once (gEnter)

Select multiple frequency groups with s, then press gEnter to combine them into one filtered sheet.

# From the frequency table:
# Move to 'engineer' → press s (select)
# Move to 'analyst' → press s (select)
gEnter
# Combined sheet opens with ALL engineers AND analysts

Result — one sheet with both groups:

name role region salary
Alice engineer sg 85000
Carol engineer sg 78000
Eve engineer jk 72000
Grace engineer jk 70000
Frank analyst kl 65000
tip

Use gEnter to combine non-contiguous groups (e.g., all error codes) into a single working sheet — much faster than doing multiple | selections on the source sheet.


Multi-Column Frequency (gF)

Mark multiple columns as key columns with !, then press gF for a frequency table grouped by all of them.

# Move to 'role', press ! → key column 1
# Move to 'region', press ! → key column 2
gF

Result — grouped by role + region combinations:

role region count
engineer jk 2
engineer sg 2
manager kl 1
manager sg 1
analyst kl 1

Quick Column Summary (zF)

zF gives a one-line statistical summary for all columns at once.

zF

Shows for every column: count, distinct values, min, max, mean, stdev.


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

Troubleshooting

ProblemCauseFix
Frequency table shows one group per rowColumn has unique valuesUse a categorical column (role, region, status)
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 is slowVery many distinct valuesUse --max-rows to sample

Hands-On Practice

vd ~/github/practice-folder/visidata/01-loading/01-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 s on 'engineer' and 'analyst' rows
# 9. Press gEnter → combined sheet with both groups
# 10. Press q → return to source

What's Next