SciRuby/daru

Should we support duplicated keys in an index?

Open

#259 geöffnet am 12. Sept. 2016

Auf GitHub ansehen
 (16 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Ruby (140 Forks)github user discovery
help wantedquestion

Repository-Metriken

Stars
 (1.060 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Daru::Vector.new([1,2,3], index: [1,1,1])
=> IndexError: Expected index size >= vector size. Index size : 1, vector size : 3

Daru::Index.new([1,1,1])
=> #<Daru::Index(1): {1}>

Index#initialize uses @relation_hash = index.each_with_index.to_h.freeze, this causes

[1,2,1].each_with_index.to_h
=> {1=>2, 2=>1}

Contributor Guide