Giter VIP home page Giter VIP logo

Comments (2)

harold avatar harold commented on June 6, 2024

Hi! Thanks for the issue - very interesting one.

Maybe something did change here, because something similar came up recently on zulip: https://clojurians.zulipchat.com/#narrow/stream/236259-tech.2Eml.2Edataset.2Edev/topic/select.20via.20boolean.20broken.3F

In your case here, you can get the result you expect by not using a clojure vector:

user> (require '[tech.v3.dataset :as ds])
nil
user> (def ds (ds/->dataset [{:a 1 :b 2} {:a 2 :b 3} {:a 3 :b 4}]))
#'user/ds
user> (ds/select ds :all  [true true true])
_unnamed [3 2]:

| :a | :b |
|---:|---:|
|  2 |  3 |
|  2 |  3 |
|  2 |  3 |
user> (ds/select ds :all  (dtype/make-list :boolean [true true true]))
_unnamed [3 2]:

| :a | :b |
|---:|---:|
|  1 |  2 |
|  2 |  3 |
|  3 |  4 |

As we discovered in that zulip exchange, the types are determined in a fairly specific way:

(= (dtype/elemwise-datatype selection) :boolean)

So, ...

user> (dtype/elemwise-datatype [true true true])
:object
user> (dtype/elemwise-datatype (dtype/make-list :boolean [true true true]))
:boolean

Would be interested to know what @cnuernber thinks about this now that it has come up twice. (:

from tech.ml.dataset.

harold avatar harold commented on June 6, 2024

PR: #390

Lots of options here, not sure this is the best, but we can iterate from here... (:

from tech.ml.dataset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.