Unable to generate npz file
clyang opened this issue · comments
clyang commented
Following the instruction on README but no gzipped file is generated.
Sample code:
package main
import (
"os"
"compress/gzip"
"github.com/kshedden/gonpy"
)
func main() {
data := []float64{0, 1, 2, 3, 4, 5, 6, 7}
f, _ := os.Open("data.npy.gz")
g := gzip.NewWriter(f)
w, _ := gonpy.WriterFromStream(g)
w.Shape = []int{4, 2}
_ = w.WriteFloat64(data)
f.Close()
}
Kerby Shedden commented
There was an error in the README. Open
should have been Create
. It is fixed now. Thanks for the report.