daru
https://github.com/sciruby/daru
Ruby
Data Analysis in RUby
Daru::DataFrame#vector_by_calculation
DSL for yielding each row and returning a Daru::Vector based on the
value each run of the block returns.
== Usage
a1 = Daru::Vector.new([1, 2, 3, 4, 5, 6, 7])
a2 = Daru::Vector.new([10, 20, 30, 40, 50, 60, 70])
a3 = Daru::Vector.new([100, 200, 300, 400, 500, 600, 700])
ds = Daru::DataFrame.new({ :a => a1, :b => a2, :c => a3 })
total = ds.vector_by_calculation { a + b + c }
# <Daru::Vector:82314050 @name = nil @size = 7 >
# nil
# 0 111
# 1 222
# 2 333
# 3 444
# 4 555
# 5 666
# 6 777Edit
git clone [email protected]:sciruby/daru.git
cd daru
open lib/daru/dataframe.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Daru--DataFrame-vector_by_calculation-for-pr
# Commit to gitgit add lib/daru/dataframe.rbgit commit -m "better docs for Daru::DataFrame#vector_by_calculation"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Daru--DataFrame-vector_by_calculation-for-pr
hub pull-request
# Celebrate!