npy

package module
v0.0.0-...-8751e67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2018 License: MIT Imports: 7 Imported by: 0

README

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

Documentation

Overview

Package npy provides functions to read in Python numpy data files into Go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(fname string) (rows int, cols int, data []float64, err error)

Read returns the number of rows, columns and the data array corresponding to a dense float64 numpy matrix stored in the input file

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL