daru

https://github.com/sciruby/daru

Ruby

Data Analysis in RUby

Daru::Vector.new_with_size

Create a new vector by specifying the size and an optional value
and block to generate values.

== Description

The *new_with_size* class method lets you create a Daru::Vector
by specifying the size as the argument. The optional block, if
supplied, is run once for populating each element in the Vector.

The result of each run of the block is the value that is ultimately
assigned to that position in the Vector.

== Options
:value
All the rest like .new

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-new_with_size-for-pr


# Commit to git

git add lib/daru/vector.rbgit commit -m "better docs for Daru::Vector.new_with_size"


# 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-new_with_size-for-pr

hub pull-request


# Celebrate!