The .npz format looks like it can contain multiple arrays expressed as
python array constants, possibly also compressed.

So you are going to potentially need an uncompress routine, and a
parser for a subset of python syntax. That's certainly doable, but it
also sounds like a multi-day (possibly multi-week) project, to
implement fully. Still... we have some occasional visitors here who
spend some significant time with both J and Python. And it is possible
that one of them has ventured into this territory...

(On the other hand, if you have a constrained problem - especially if
the files aren't compressed - you can probably implement something
quick and easy which doesn't try to be general and just parses the
kinds of arrays you're looking for. You haven't give enough hints,
yet, about your needs, for us to suggest anything specific along that
line...)

FYI,

--
Raul

On Tue, Dec 4, 2018 at 5:34 PM Devon McCormick <devon...@gmail.com> wrote:
>
> Has anyone written code to convert arrays in the numpy save format (.npz
> file) to an array in J?  An example of the MNIST digits recognition set is
> here: https://s3.amazonaws.com/img-datasets/mnist.npz .
>
> I was looking to do this myself.   At the moment, I'm thinking of using
> Python to read in the array, then write it back out in a text format that J
> can read and turn into a J array but this sounds cumbersome.
>
> Does anyone have a better, more direct way than this?
>
> Thanks,
>
> Devon
> --
>
> Devon McCormick, CFA
>
> Quantitative Consultant
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to