README.md in npy-0.1.0 vs README.md in npy-0.1.1

- old
+ new

@@ -1,11 +1,13 @@ # Npy -Load NumPy `npy` and `npz` files in Ruby - no Python required +Save and load NumPy `npy` and `npz` files in Ruby - no Python required :fire: Uses [Numo::NArray](https://github.com/ruby-numo/numo-narray) for blazing performance +[![Build Status](https://travis-ci.org/ankane/npy.svg?branch=master)](https://travis-ci.org/ankane/npy) + ## Installation Add this line to your application’s Gemfile: ```ruby @@ -16,10 +18,17 @@ ### npy `npy` files contain a single array +Save an array + +```ruby +arr = Numo::Int32[0...10] +Npy.save("x.npy", arr) +``` + Load an `npy` file ```ruby arr = Npy.load("x.npy") ``` @@ -33,10 +42,18 @@ ### npz `npz` files contain multiple arrays +Save multiple arrays + +```ruby +x = Numo::Int32[0...10] +y = x * 2 +Npy.save_npz("mnist.npz", x: x, y: y) +``` + Load an `npz` file ```ruby arrs = Npy.load_npz("mnist.npz") ``` @@ -56,9 +73,11 @@ Arrays are lazy loaded for performance ## Resources - [npy format](https://docs.scipy.org/doc/numpy/reference/generated/numpy.lib.format.html#module-numpy.lib.format) +- [NumPy data types](https://docs.scipy.org/doc/numpy/user/basics.types.html) +- [Numo::NArray docs](https://ruby-numo.github.io/narray/narray/Numo/NArray.html) ## History View the [changelog](https://github.com/ankane/npy/blob/master/CHANGELOG.md)