daru

https://github.com/sciruby/daru

Ruby

Data Analysis in RUby

Daru::DataFrame#one_to_many

Creates a new dataset for one to many relations
on a dataset, based on pattern of field names.

for example, you have a survey for number of children
with this structure:
  id, name, child_name_1, child_age_1, child_name_2, child_age_2
with
  ds.one_to_many([:id], "child_%v_%n"
the field of first parameters will be copied verbatim
to new dataset, and fields which responds to second
pattern will be added one case for each different %n.

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


# Commit to git

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


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

hub pull-request


# Celebrate!