daru

https://github.com/sciruby/daru

Ruby

Data Analysis in RUby

Daru::Category#to_ints

Returns integer coding for categorical data in the order starting from 0.
For example if order is [:a, :b, :c], then :a, will be coded as 0, :b as 1 and :c as 2

Source | Google | Stack overflow

Edit

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

cd daru

open lib/daru/category.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Daru--Category-to_ints-for-pr


# Commit to git

git add lib/daru/category.rbgit commit -m "better docs for Daru::Category#to_ints"


# 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--Category-to_ints-for-pr

hub pull-request


# Celebrate!