Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.
/ go-npy Public archive

Read matrices in numpy's npy format into Go

License

Notifications You must be signed in to change notification settings

mendelics/go-npy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-npy

Read in .npy files produced by numpy into Go

Build Status GoDoc

###Usage

import (
  npy "github.com/cquotient/go-npy"
  "github.com/gonum/matrix/mat64"
)
...

rows, cols, data, err := npy.Read("data/dense.py")
x := mat64.NewDense(int(rows), int(cols), data)

###Caveats

  • This is a hack, but it does work for us
  • Only supports dense float64 matrices
  • .npz files are not currently supported
  • Assumes a single matrix in the file

###npy format documentation https://github.com/numpy/numpy/blob/master/doc/neps/npy-format.rst

About

Read matrices in numpy's npy format into Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages