SciRuby / daru

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

rolling_fillna! bugfixes on Daru::Vector and Daru::DataFrame #447

Closed mhammiche closed 6 years ago

mhammiche commented 6 years ago

According to documentation rolling_fillna! should return the modified object Actually the Vector is correctly updated but it return the index!

dv = Daru::Vector.new([1, 2, 1, 4, nil, Float::NAN, 3, nil, Float::NAN])
dv.rolling_fillna!(:forward)
# => #<Daru::Index(9): {0, 1, 2, 3, 4, 5, 6, 7, 8}>
dv
=> #<Daru::Vector(9)>
   0   1
   1   2
   2   1
   3   4
   4   4
   5   4
   6   3
   7   3
   8   3

rolling_fillna is not working either as it clone the object before calling rolling_fillna!

zverok commented 6 years ago

Thanks!