daru
https://github.com/sciruby/daru
Ruby
Data Analysis in RUby
Daru::ArrayHelper#recode_repeated
Recode repeated values on an array, adding the number of repetition
at the end
Example:
a=%w{a b c c d d d e}
a.recode_repeated
=> ["a","b","c_1","c_2","d_1","d_2","d_3","e"]Edit
git clone [email protected]:sciruby/daru.git
cd daru
open lib/daru/helpers/array.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Daru--ArrayHelper-recode_repeated-for-pr
# Commit to gitgit add lib/daru/helpers/array.rbgit commit -m "better docs for Daru::ArrayHelper#recode_repeated"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Daru--ArrayHelper-recode_repeated-for-pr
hub pull-request
# Celebrate!