clbustos / statsample

A suite for basic and advanced statistics on Ruby.
http://github.com/clbustos/statsample
BSD 3-Clause "New" or "Revised" License
402 stars 96 forks source link

Dataset join #29

Closed mqzhang closed 10 years ago

mqzhang commented 10 years ago

Add a join function for Dataset:

a = {'a' => [1,2].to_vector, 'b' => [2,3].to_vector}.to_dataset
b = {'c' => [1,2].to_vector, 'd' => [5,6].to_vector}.to_dataset
c = {'a' => [1,2].to_vector, 'b' => [2,3].to_vector, 'd' => [5,6].to_vector}.to_dataset
p c == a.join(b,['a'],['c']) # => true
clbustos commented 10 years ago

Thanks! If you can add the test, should be great.

mqzhang commented 10 years ago

@clbustos Thanks to accept it. Sorry I don't know how to add the test. I used an external script with a monkey patch to test the function.