Skip to content

naitoh/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 the successor to Ruby/NArray.

Documentation

All documents are primitive.

Related Projects

Installation

Requirement

Ruby ver 2.1 and later.

Ubuntu, Debian, Bash on Windows

apt install -y git ruby gcc ruby-dev rake make
gem install specific_install
gem specific_install https://github.com/ruby-numo/numo-narray.git

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).

Development

Build

ruby setup.rb

Run tests

bundle install
bundle exec rake test

Tips: You may run tests defined in a specified line as:

bundle exec ruby test/bit_test.rb --location 27

About

Ruby/Numo::NArray - New NArray class library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 69.6%
  • Ruby 17.3%
  • Jupyter Notebook 12.9%
  • Other 0.2%