[Numpy-discussion] numpy array serialization with JSON

Chris.Barker Chris.Barker@noaa....
Tue Nov 11 20:01:50 CST 2008

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(array) or repr(array) would work just fine 
with very little massaging. A call to numpy.set_printoptions() would be 
a good idea first, though.


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception


More information about the Numpy-discussion mailing list