README.md in npy-0.1.1 vs README.md in npy-0.1.2
- old
+ new
@@ -1,10 +1,10 @@
# Npy
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
+:fire: Uses [Numo](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
@@ -21,54 +21,54 @@
`npy` files contain a single array
Save an array
```ruby
-arr = Numo::Int32[0...10]
-Npy.save("x.npy", arr)
+x = Numo::Int32[0..9]
+Npy.save("x.npy", x)
```
Load an `npy` file
```ruby
-arr = Npy.load("x.npy")
+x = Npy.load("x.npy")
```
Load an `npy` string
```ruby
byte_str = File.binread("x.npy")
-arr = Npy.load_string(byte_str)
+x = Npy.load_string(byte_str)
```
### npz
`npz` files contain multiple arrays
Save multiple arrays
```ruby
-x = Numo::Int32[0...10]
+x = Numo::Int32[0..9]
y = x * 2
-Npy.save_npz("mnist.npz", x: x, y: y)
+Npy.save_npz("data.npz", x: x, y: y)
```
Load an `npz` file
```ruby
-arrs = Npy.load_npz("mnist.npz")
+data = Npy.load_npz("data.npz")
```
Get keys
```ruby
-arrs.keys
+data.keys
```
Get an array
```ruby
-arrs["x"]
+data["x"]
```
Arrays are lazy loaded for performance
## Resources