-
I'm trying to add a custom command that computes the frequency of numerical columns. I've got it mostly working, except that every time I invoke it I get a status warning:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Every argument to Line 520 in 8f823f5 The solution is to use
Also, a feature that may help you as you write code for visidata: to examine a traceback for errors like this, run the command In this example, the traceback would offer this clue on where to look or add debug statements:
|
Beta Was this translation helpful? Give feedback.
Every argument to
addColumn()
except the named argumentindex
is treated like a list of columns because of*cols
:visidata/visidata/sheets.py
Line 520 in 8f823f5
The solution is to use
index=
in front of your column index:Sheet.addCommand('z.', 'addcol-freq', 'addColumn(FrequencyColumn(cursorCol), index=cursorColIndex+1)')
Also, a feature that may help you as you write code for visidata: to examine a traceback for errors like this, run the command
error-recent
(with the shortcutCtrl+E
). Or if you have more than one error,errors-all
.In this example, the traceback would offer this clue on where to look or add debug statements: