Skip to content

metanest/numo-narray

 
 

Repository files navigation

Numo::NArray - New NArray class library for Ruby/Numo (NUmerical MOdule)

Binder Build Status

GitHub | RubyGems

Numo::NArray is an Numerical N-dimensional Array class for fast processing and easy manipulation of multi-dimensional numerical data, similar to numpy.ndaray. This project is a successor to Ruby/NArray.

under development

Related Projects

Installation

Ubuntu, Debian

apt install -y git ruby gcc ruby-dev rake make
git clone git://github.com/ruby-numo/narray
cd narray
gem build numo-narray.gemspec
gem install numo-narray-0.9.0.3.gem

Quick start

An example

[1] pry(main)> require "numo/narray"
=> true
[2] pry(main)> a = Numo::DFloat.new(3,5).seq
=> Numo::DFloat#shape=[3,5]
[[0, 1, 2, 3, 4],
 [5, 6, 7, 8, 9],
 [10, 11, 12, 13, 14]]
[3] pry(main)> a.shape
=> [3, 5]
[4] pry(main)> a.ndim
=> 2
[5] pry(main)> a.class
=> Numo::DFloat
[6] pry(main)> a.size
=> 15

For more examples, check out this narray version of 100 numpy exercises (and the IRuby Notebook).

Documentation

All documents are primitive.

Running RSpec

(in advance, install gem with --development option)

$ "${HOME}/.gem/ruby/2.?/bin/rspec" "${HOME}/.gem/ruby/2.4/gems/numo-narray-0.9.?.?/spec/bit_spec.rb"
$ "${HOME}/.gem/ruby/2.?/bin/rspec" "${HOME}/.gem/ruby/2.4/gems/numo-narray-0.9.?.?/spec/narray_spec.rb"

YARD documents generation

(in advance, install yard gem)

$ cd "${HOME}/.gem/ruby/2.?/gems/numo-narray-0.9.?.?/ext/numo/narray"
$ make doc
yard doc *.c types/*.c
...

About

forked from ruby-numo/narray (upstream-project: http://ruby-numo.github.io/narray/ )

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 72.3%
  • Jupyter Notebook 15.2%
  • Ruby 12.4%
  • Other 0.1%