SciRuby / daru

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

where clause when data contains missing/undefined values #312

Closed Shekharrajak closed 7 years ago

Shekharrajak commented 7 years ago

Fixes https://github.com/SciRuby/daru/issues/246

irb(main):001:0> v= Daru::Vector.new([1,2,3,Float::NAN, nil])
=> #<Daru::Vector(5)>
   0   1
   1   2
   2   3
   3 NaN
   4 nil
irb(main):002:0> v.where(v.lt(4))
=> #<Daru::Vector(3)>
   0   1
   1   2
   2   3
irb(main):003:0> v.where(v.lt(3))
=> #<Daru::Vector(2)>
   0   1
   1   2
irb(main):004:0> v.where(v.lt(2))
=> #<Daru::Vector(1)>
   0   1
irb(main):005:0> v.where(v.lt(1))
=> #<Daru::Vector(0)>
Shekharrajak commented 7 years ago

when I do bundle exec rspec in my system I don't get any error. I didn't understand this travis failure.

Also I don't find these errors :

/spec/vector_spec.rb:1397 # Daru::Vector#is_values single value to_a should eq [true, false, true, false, false]
rspec ./spec/vector_spec.rb:1403 # Daru::Vector#is_values multiple values to_a should eq [true, false, true, true, true]

in spec/vector_spec.rb:1397 and 1403 line I don't find those lines.

zverok commented 7 years ago

@Shekharrajak looks like some Travis flakiness (maybe due to those S3 problems, that ruined half-the-internet yesterday?) Now it shows "There was an error while loading data." :man_facepalming:

Try rerun build? (Commit something dummy, or close and reopen PR)

Shekharrajak commented 7 years ago

Thanks @zverok , I have closed and reopen the PR.

zverok commented 7 years ago

Travis is ill now :( https://www.traviscistatus.com Let's wait. I'll review the PR in the meantime

Shekharrajak commented 7 years ago

@zverok , I have updated the PR branch(rebase with upstream/master) and fixed the error.

Shekharrajak commented 7 years ago

@zverok ,I think this PR is good to go.