                              (.readDouble price-data
                                                 (max 0 (dec idx)))))))

#'user/stocks-lag
user&gt; (ds/head (assoc stocks-lag "price-lag-diff" (dfn/- (stocks-lag "price")
                                                         (stocks-lag "price-lag"))))
test/data/stocks.csv [5 5]:

| symbol |       date | price | price-lag | price-lag-diff |
|--------+------------+-------+-----------+----------------|
|   MSFT | 2000-01-01 | 39.81 |     39.81 |       