Re: [Numpy-discussion] numpy array serialization with JSON

2008-11-11 Thread Chris.Barker
Simon Palmer wrote: > "Does JSON have a representation for n-d arrays? In my little work with > it, it looked pretty lame for arrays of number, so I'd be surprised." > > yes it does, thet are just treated as nested lists and the square > bracket notation is used. then it looks like one of str(ar

Re: [Numpy-discussion] numpy array serialization with JSON

2008-11-11 Thread Simon Palmer
"Does JSON have a representation for n-d arrays? In my little work with it, it looked pretty lame for arrays of number, so I'd be surprised." yes it does, thet are just treated as nested lists and the square bracket notation is used. JSON is far from perfect but for objects of basic types it is ab

Re: [Numpy-discussion] numpy array serialization with JSON

2008-11-10 Thread Christopher Barker
Travis E. Oliphant wrote: > numpy.set_printoptions(threshold=1000) just to be clear, will: numpy.set_printoptions(threshold=None) restore the default? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600

Re: [Numpy-discussion] numpy array serialization with JSON

2008-11-10 Thread Travis E. Oliphant
Christopher Barker wrote: > Matthieu Brucher wrote: > >> Last time I checked, repr() does the same thing as str(): the middle >> of the array may not be displayed... >> > > right. darn -- is that controllable? > numpy.set_printoptions(threshold=1000) -Travis __

Re: [Numpy-discussion] numpy array serialization with JSON

2008-11-10 Thread Robert Kern
On Mon, Nov 10, 2008 at 12:18, Christopher Barker <[EMAIL PROTECTED]> wrote: > Matthieu Brucher wrote: >> Last time I checked, repr() does the same thing as str(): the middle >> of the array may not be displayed... > > right. darn -- is that controllable? set_printoptions() > It also breaks the a

Re: [Numpy-discussion] numpy array serialization with JSON

2008-11-10 Thread Christopher Barker
Matthieu Brucher wrote: > Last time I checked, repr() does the same thing as str(): the middle > of the array may not be displayed... right. darn -- is that controllable? It also breaks the axum: eval(repr(x)) == x but I guess with big arrays, this in one of those times that: "Practicality bea

Re: [Numpy-discussion] numpy array serialization with JSON

2008-11-10 Thread Matthieu Brucher
> If you're thinking JSON, then I think you'd want text, not binary. Maybe > you can make use of the repr()? Last time I checked, repr() does the same thing as str(): the middle of the array may not be displayed... Matthieu -- Information System Engineer, Ph.D. Website: http://matthieu-brucher.d

Re: [Numpy-discussion] numpy array serialization with JSON

2008-11-10 Thread Christopher Barker
Simon Palmer wrote: > What, if any, header information from numarray gets put in the bytes by > tostring(), especially as I have n dimensions? none, you'd have to do that separately. > I am very likely to be deserializing into a Java Array object (or maybe > a double[]) and it is not clear to m

Re: [Numpy-discussion] numpy array serialization with JSON

2008-11-10 Thread Simon Palmer
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.

Re: [Numpy-discussion] numpy array serialization with JSON

2008-11-10 Thread Robert Kern
On Mon, Nov 10, 2008 at 11:25, Simon Palmer <[EMAIL PROTECTED]> 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

[Numpy-discussion] numpy array serialization with JSON

2008-11-10 Thread Simon Palmer
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. I'm currently us