scicloj / tablecloth.time

Tools for the processing and manipulation of time-series data in Clojure.
Other
18 stars 1 forks source link

Slice not working on year column that is int #57

Open ezmiller opened 2 years ago

ezmiller commented 2 years ago

See here:

| :Passengers |      :Date | :Year |
|------------:|------------|---------:|
|         112 | 1949-01-01 |     1949 |
|         118 | 1949-02-01 |     1949 |
|         132 | 1949-03-01 |     1949 |
|         129 | 1949-04-01 |     1949 |
|         121 | 1949-05-01 |     1949 |
|         135 | 1949-06-01 |     1949 |
|         148 | 1949-07-01 |     1949 |
|         148 | 1949-08-01 |     1949 |
|         136 | 1949-09-01 |     1949 |
|         119 | 1949-10-01 |     1949 |

(-> prepped-data
    (tc/add-column :Year
                   (fn [ds]
                     (map #(.getYear %) (:Date ds))))
    (tct/index-by :Year)
    (tct/slice 1949 1950)
    )

This errors:

Time unit of from does not match index time unit: :int32

Something's wrong in the way slice is parsing the argument types here. Could be that there is a mismatch between an :int64 and :int32?