-
-
Notifications
You must be signed in to change notification settings - Fork 312
Description
Small description
Given a column of values, I want to create a column containing the values of this column from the previous row.
test |
---|
A |
B |
C |
D |
I press w
, and input 1 0
to create a column with 1 previous value, and 0 subsequent values:
I now create a new column with the previous values using =test_window[0]
:
This yields exactly what I want, except in the first row.
Rather than the previous (NULL
) value, I get the value of the current row:
Expected result
I expect the window list to always contain 2 values, and be padded with None
when the previous value does not exist, such as for the first window record. This might look like the following:
Steps to reproduce with sample data and a .vd
Additional context
Please include the version of VisiData and Python.
saul.pw/VisiData v3.0.1
Python 3.10.12