Convert NPZ to JSON
Turn NPZ files into JSON files. One JSON file for each array in the archive, named after it, holding the array 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 NPZ files on the dialor turn it to pick what to do
One JSON file for each array in your archive.Each array keeps its shape, and each file is named after its array.
What you get
The archive holds several arrays, each under its own name. The conversion writes one JSON file per array, named after it, so you end up with one or more files.
Each array keeps its shape as nested lists, with one level for each axis. A record array becomes a list of 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. A null in the output can therefore mean a missing number, a missing date or an infinite value.
What it does not load
Arrays of Python objects are not loaded. Unpickling them could run code, so the conversion stops with
unsupported_elementswhen the archive holds one.Next steps
Once the arrays are JSON, merge JSON can join the files. For other targets, see every JSON conversion.
NPZ and JSON.What each format is.
The formats
NumPy Archive
Several NumPy arrays zipped together by numpy.savez, each under its own name.
- Extensions
- .npz
- MIME type
- application
/x -npz - 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 NPZ to JSON conversion through the API, for your app or your agent.
$ cv convert report.npz report/ --to json$ cv convert report.npz report/ --to jsonQuestions.What people ask about NPZ to JSON.
One file for each array in the archive. Each file is named after its array.
As objects keyed by field name. Other arrays are written as nested lists, one level for each axis.
They become null, along with NaT. JSON cannot hold these values.
The archive holds an array of Python objects. These are not loaded, since unpickling them could run code.