SciRuby/daru

Should we support duplicated keys in an index?

Open

#259 创建于 2016年9月12日

在 GitHub 查看
 (16 评论) (0 反应) (0 负责人)Ruby (140 fork)github user discovery
help wantedquestion

仓库指标

Star
 (1,060 star)
PR 合并指标
 (PR 指标待抓取)

描述

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}

贡献者指南