SciRuby / daru

Data Analysis in RUby
BSD 2-Clause "Simplified" License
1.04k stars 139 forks source link

Comparison Operator for Daru::Vector #287

Closed genya0407 closed 7 years ago

genya0407 commented 7 years ago

Daru::Vector#> , which is method alias of Daru::Vector#gt , should be much convenient, but it seems that there isn’t such method. Is there any supecial reasons ? Of course, I think other comparison operators should be also exist.

What I imagine:

vector = Daru::Vector.new([1,2,3,4,5])

vector.where((vector > 1) & (vector < 5)) # => Daru::Vector.new([2,3,4])
v0dro commented 7 years ago

Works. There's no real reason why its not there. I guess I'm lazy.