SciRuby / daru

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

Incostencies in behaviour of DataFrame. #515

Open weqopy opened 5 years ago

weqopy commented 5 years ago

EDIT (@v0dro): Following is a list of method that should be implemented/corrected to get more consistency:

Ideally these should be split into separate issues and tackled one at a time.


I'd like to use this data to show the situation made me confused:

[25] pry(main)> dates=["2018-03-30", "2018-04-02", "2018-04-27", "2018-05-31", "2018-06-29", "2018-07-31", "2018-08-31", "2018-09-28", "2018-10-31", "2018-11-30"]
=> ["2018-03-30",
 "2018-04-02",
 "2018-04-27",
 "2018-05-31",
 "2018-06-29",
 "2018-07-31",
 "2018-08-31",
 "2018-09-28",
 "2018-10-31",
 "2018-11-30"]
[26] pry(main)> val=[1.00000001, 0.9999, 0.9908, 1.0885, 1.0586, 1.0374, 0.9456, 0.9638, 0.8397, 0.8788]
=> [1.00000001, 0.9999, 0.9908, 1.0885, 1.0586, 1.0374, 0.9456, 0.9638, 0.8397, 0.8788]
[27] pry(main)> id=Daru::DateTimeIndex.new(dates)
=> #<Daru::DateTimeIndex(10) 2018-03-30T00:00:00+00:00...2018-11-30T00:00:00+00:00>
[28] pry(main)> df = Daru::DataFrame.new({val: val}, index: id)
=> #<Daru::DataFrame(10x1)>
                   val
 2018-03-30 1.00000001
 2018-04-02     0.9999
 2018-04-27     0.9908
 2018-05-31     1.0885
 2018-06-29     1.0586
 2018-07-31     1.0374
 2018-08-31     0.9456
 2018-09-28     0.9638
 2018-10-31     0.8397
 2018-11-30     0.8788
kojix2 commented 4 years ago

I think the gods left room for you to contribute. I'm sorry I'm just kidding.

v0dro commented 4 years ago

I'm editing the issue comment to make an itemized list of issue items that can be tackled by a group of volunteers.