visidata
Table of Contents
1. Basic usage
1.1. Concepts
1.1.1. Sheets
Understanding Sheets — An Introduction to VisiData
- Source sheets
- Derived sheets
- Meta sheets
- Sheet sheet :
SHFT+S
- Column sheet :
SHFT+C
- Sheet sheet :
1.2. Operations
- Menu:
CTRL+h
- Abort:
CTRL+c
- Save:
CTRL+S
(Doing editing does not save) - Copy:
gY
- Undo:
SHFT+U
- Redo:
SHFT+R
- Quit
- Quit sheet:
q
- Graceful quit:
gq
- Quit visidata:
CTRL+q
(force)
- Quit sheet:
1.3. Navigation
- Highlight current:
CTRL+g
- hjkl / g(hjkl)
- Page Down:
CTRL+F
- Page Up:
CTRL+B
1.4. Search
- Forward: / or g/ or z/
- Backward: ? or g? or z?
- Match:
n
(next match),N
(previous match)
1.5. Editing
e
,CTRL+e
(end),CTRL+a
(start)- Move columns & Rows:
SHFT+(HJKL)
1.6. Rows
- Selection
- Select:
s
/gs
- Unselect:
u
/gu
- Toggle select:
t
/gt
- Select:
- Sorting:
[
and]
- Selection by patterns
- Select match
|
+ term (current column),
: Shorthand to select rows where current column match row’s value for that columng|
+ term (any column)
- Unselect match
\
+ term (current column)g\
+ term (any column)
- Select match
- Select by Python expression
z|
: Then type in python expr
1.7. Columns
NOTE: Most of these edits can be made from the Column Sheet too.
- Assign Data Types
- When sheet is open, go to the column and press
#
,%
,$
(currency),@
(date),~
- or
z~
to undo datatype change for a column
- When sheet is open, go to the column and press
- Pin/Key column:
!
but useful if you - Rename column:
^
- Hides column:
-
(0 width) - You can also change the widths etc
z-
: Half widthg_
: expand width of all columns (auto adjust)
1.7.1. Create columns
za
: new columni
: add increment column=
and then Python expr: Create new column with expression. EgHEIGHT >= 100
:
: Press:
and the delimiter, we'll have n number of columns based on the specified delimiter.;
: Press:
and the regex with capture group.
1.8. Summarization
- Frequency:
SHFT+F
- Multi-Column: First key the column(s) using
!
, thengF
(Eg. Year and Publisher Groupby)
- Multi-Column: First key the column(s) using
- One off calculations
- Describe sheet:
Shift+I
1.8.1. Aggregations
- When doing frequency with
SHFT+F
, we can do aggregations/groupby by other numeric columns also. - Fist make sure the column has numeric type, then use
+
andCTRL+x
to select theaggregation
function aggregation
column can be seen in theColumn Sheet
1.8.2. One off calculations
z+
, thenCTRL+x
and thenEnter
1.8.3. Pivot table
- Select row(s) as key using
!
+
: If we want to specify the function, by default is count- Navigate to the column to be made columns in the pivot table and
SHFT+w
1.9. Filter
"
(once selected, creates copy)- Once we get freq sheet using
SHFT+F
, we can select multiple rows and create a new sheet out of them usingg+Enter