I'm trying to replicate tensorflow code for machine-learning and a lot of
the examples use this dataset, so I'd like to be able to read it into J
easily.  I want the Python->J-array capability because there are probably
other datasets more easily obtained in this format.

Looking more closely at the format, the underlying files in the compressed
package look simple to decode in J, so I'll do that and report back on what
I come up with.


On Tue, Dec 4, 2018 at 5:42 PM Raul Miller <rauldmil...@gmail.com> wrote:

> 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



-- 

Devon McCormick, CFA

Quantitative Consultant
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to