daru

https://github.com/sciruby/daru

Ruby

Data Analysis in RUby

Daru::DataFrame#recode

Maps over the DataFrame and returns a DataFrame. Each run of the
block must return a Daru::Vector object. You can specify the axis
to map over. Default to :vector.

== Description

Recode works similarly to #map, but an important difference between
the two is that recode returns a modified Daru::DataFrame instead
of an Array. For this reason, #recode expects that every run of the
block to return a Daru::Vector.

Just like map and each, recode also accepts an optional _axis_ argument.

== Arguments

* +axis+ - The axis to map over. Can be :vector (or :column) or :row.
Default to :vector.

Source | Google | Stack overflow

Edit

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

cd daru

open lib/daru/dataframe.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Daru--DataFrame-recode-for-pr


# Commit to git

git add lib/daru/dataframe.rbgit commit -m "better docs for Daru::DataFrame#recode"


# 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--DataFrame-recode-for-pr

hub pull-request


# Celebrate!