tech.ml.dataset icon indicating copy to clipboard operation
tech.ml.dataset copied to clipboard

new empty column is set to boolean datatype

Open genmeblog opened this issue 3 years ago • 2 comments

(tech.v3.dataset.column/new-column :a [])
;; => #tech.v3.dataset.column<boolean>[0]
;;    :a
;;    []

Is there a way to force a datatype during creation of column?

genmeblog avatar May 16 '22 14:05 genmeblog

Yes - use the map constructor form - or use empty container of target datatype - will have example forthcoming.

cnuernber avatar May 16 '22 18:05 cnuernber

The only thing that will work is to create an empty container of the target datatype -

user> (require '[tech.v3.datatype :as dt])
nil
user> (ds/new-column :a (dt/make-reader :float32 0 nil))
#tech.v3.dataset.column<float32>[0]
:a
[]

cnuernber avatar May 17 '22 18:05 cnuernber

Closing this for now. This isn't clearly an issue - boolean is the root of the type hierarchy.

cnuernber avatar Sep 17 '22 13:09 cnuernber