Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby equivalent of NumPy

Tags:

ruby

numpy

I'd like to be able to get averages, medians, percentiles, etc. I've been looking all over and can't find anything like it. I realize that Ruby isn't used very much in the scientific world, but there has to exist at least a very basic library in Ruby that does math, right?

like image 281
guidoism Avatar asked Apr 13 '11 18:04

guidoism


2 Answers

How about ruby narray?

http://narray.rubyforge.org/

If you look at the methods, there is a section on statistics that covers your use cases:

http://narray.rubyforge.org/SPEC.en

You might also want to look at the ruby bindings to the GSL:

http://ruby-gsl.sourceforge.net/

like image 80
JoshAdel Avatar answered Oct 04 '22 03:10

JoshAdel


SciRuby is working on this. We're actually working on NMatrix as a replacement for NArray. The most relevant library for you, however, would likely be Statsample.

And, as mentioned by JoshAdel, Ruby/GSL is a pretty useful gem. We have a fork of it in SciRuby's github account which supports NMatrix instead of NArray.

like image 29
Translunar Avatar answered Oct 04 '22 02:10

Translunar