SciRuby/daru

Should we support duplicated keys in an index?

Open

#259 aberto em 12 de set. de 2016

Ver no GitHub
 (16 comments) (0 reactions) (0 assignees)Ruby (140 forks)github user discovery
help wantedquestion

Métricas do repositório

Stars
 (1.060 stars)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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}

Guia do colaborador