Creating non-numeric pivot tables with VisiData (recipe three)

Viva Enrico Bergamini

Andrea Borruso
mai più senza

--

As Enrico has written in his recipe one:

If you ever tried to pivot a table containing non-numeric values, you have surely been struggling with any spreadsheet app to do it easily.

He has proposed a recipe to do it, using Python pandas and pivot_table function.

In this second recipe of mine (the first one is this) I will us VisiData. The goal of Enrico is to change the original table as the image below:

These are the steps:

  • run vd tidy.csv (here the example file);
  • go over the id field and set it as key field using !;
  • go over the Value field and add max aggregator to it, using + key;
  • go over the Variable field and press Shift+W;
  • hide the two “Total” output columns, using -.

The output will be something like:

That’s all. Last thing could be rename the fields.

--

--

Andrea Borruso
mai più senza

#data #maps #GIS #baci #condivisione. Orgoglioso di essere presidente di @ondatait