Jim Cheung

VisiData

A very useful tool for data wrangling.

check this video: VisiData Lightning Demo at PyCascades 2018 - YouTube


$ pip install visidata

some quick test:

$ ps aux | vd

$ ls -l | vd -f fixed

To load another file, press o and enter a filepath.

Press S to access other loaded or derived sheets.

use < and > to move through a categorical column.

basic movement: h, j, k and l, add g before to move all the way, for example gj move to bottom

/ or ? to search (slow?)

select rows

s to select, u to unselect, t for toggling

add g in front for all, for example gs to select all

| to select by regex, `‘ to unselect by regex rows matching in current column

add g to select/unselect rows match any visible columns

, select rows matching current cell in current column

g, select rows matching currnet row in all visible columns

after selected rows

gz to open a duplicate sheet with copies of the selected rows.

add g to apply all, for example gd to delete selected rows

sort rows

type the column:

[ or ] sorts ascending/descending by current column

sort by multiple rows

  1. Press ! on those columns to designate them as key columns.
  2. Press g[ or g] to sort.

columns

! pins the current column on the left as a key column

H or L slides the current column one position to the left/right (add g to move to all the way)

- (hyphen) to hide the current column.

unhide:

type a column:

type multiple columns:

split a column:

concatenate columns:

  1. Type = followed by Year + '-' + Month + '-' + Day
  2. Set the type of the new derived column by pressing @ (date).
  3. Type ^ followed by Date to rename the column to Date.

aggregation:

edit content

in edit mode:

rename columns:

aggregation

+ aggregator: adds aggregator to current column z+ aggregator: displays result of aggregator over values in selected rows for current column

aggregators:

pivot table

  1. Press ! on the independent variable to set it as a key column.
  2. Press + on a second column to add an aggregrate. This configures which column is to be composed in relation to others.
  3. Optional: Set the type for the column
  4. Press W on the dependent categorical variable to pivot on it.

F to open the Frequency table.

graphs

. (dot=plot) on that column

interact with graphs: http://visidata.org/docs/graph/