Convert NPY to JSON
Turn NPY files into JSON. The array as JSON in its own shape: nested lists, one level for each axis, and a record array as objects keyed by field name.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop NPY files on the dialor turn it to pick what to do
A NumPy array as plain JSON.Nested lists that match the array's shape, in one JSON file.
What you get
One JSON file with the array in its own shape. Each axis of the array becomes one level of nested lists.
A record array becomes objects keyed by field name.
How values are written
Numbers keep their shortest exact form. Dates and times become ISO 8601 text.
NaN, NaT and infinities become null, because JSON has no way to write them.
Arrays of Python objects
An array of Python objects is not loaded. Unpickling it could run code, so the conversion stops with
unsupported_elements.To combine the result with other data, you can merge JSON files afterward.
NPY and JSON.What each format is.
The formats
NumPy Array
A single NumPy array saved with numpy.save, with its shape and data type.
- Extensions
- .npy
- MIME type
- application
/x -npy - Kind
- Text and data
JSON
JSON, the data format of every API.
- Extensions
- .json
- MIME type
- application
/json - Kind
- Text and data
In your code.The same NPY to JSON conversion through the API, for your app or your agent.
$ cv convert report.npy report.json$ cv convert report.npy report.jsonQuestions.What people ask about NPY to JSON.
Yes. The lists nest one level for each axis, so the JSON has the same shape as the array.
As ISO 8601 text.
NaN, NaT and infinities become null in the JSON.
The array holds Python objects. These are not loaded, since unpickling them could run code.