scicloj / tablecloth

Dataset manipulation library built on the top of tech.ml.dataset
https://scicloj.github.io/tablecloth
MIT License
305 stars 27 forks source link

Add any Java array of arrays as a dataset creation case #69

Closed genmeblog closed 2 years ago

genmeblog commented 2 years ago

https://clojurians.zulipchat.com/#narrow/stream/151924-data-science/topic/Simple.20Tablecloth.20beginnings/near/282603903

;; object-array not supported
(-> (map object-array [["1" 2] ["3" 4]])
    (into-array)
    (tc/dataset {:column-names [:a :b]}))

;; _unnamed [1 1]:

;; |                       :$value |
;; |-------------------------------|
;; | [[Ljava.lang.Object;@5698a41c |
genmeblog commented 2 years ago

Next version:

(-> (map object-array [["1" 2] ["3" 4]])
    (into-array)
    (dataset {:column-names [:a :b]}))
;; => _unnamed [2 2]:
;;    | :a | :b |
;;    |----|----|
;;    |  1 |  3 |
;;    |  2 |  4 |