daru

https://github.com/sciruby/daru

Ruby

Data Analysis in RUby

Daru::Vector#[]=

Just like in Hashes, you can specify the index label of the Daru::Vector
and assign an element an that place in the Daru::Vector.

== Usage

  v = Daru::Vector.new([1,2,3], index: [:a, :b, :c])
  v[:a] = 999
  #=>
  ##<Daru::Vector:90257920 @name = nil @size = 3 >
  #    nil
  #  a 999
  #  b   2
  #  c   3

Source | Google | Stack overflow

Edit

git clone [email protected]:sciruby/daru.git

cd daru

open lib/daru/vector.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Daru--Vector-----for-pr


# Commit to git

git add lib/daru/vector.rbgit commit -m "better docs for Daru::Vector#[]="


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Daru--Vector-----for-pr

hub pull-request


# Celebrate!