[Numpy-discussion] numpy array serialization with JSON

Simon Palmer simon.palmer@gmail....
Mon Nov 10 11:49:53 CST 2008


What, if any, header information from numarray gets put in the bytes by
tostring(), especially as I have n dimensions?

I am very likely to be deserializing into a Java Array object (or maybe a
double[]) and it is not clear to me how I would do that from the bytes in
the tostring() representation.

On Mon, Nov 10, 2008 at 5:36 PM, Robert Kern <robert.kern@gmail.com> wrote:

> On Mon, Nov 10, 2008 at 11:25, Simon Palmer <simon.palmer@gmail.com>
> wrote:
> > Does anyone have a recommendation of a library/method for serialization
> of
> > numpy arrays to and from text (specifically for the purposes of embedding
> in
> > XML)?  I don't want to use pickle or tostring() because my XML has to be
> > consumable across a variety of programming environments.
>
> If you only need to support typical dtypes, just use tostring() (and
> base64 encoding) and a little bit of XML to provide the shape and
> dtype information.
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>  -- Umberto Eco
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20081110/670f62a6/attachment.html 


More information about the Numpy-discussion mailing list