Convert NPZ to CSV
Turn NPZ files into CSV files. One CSV with a header row for each array in the archive, named after it.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop NPZ files on the dialor turn it to pick what to do
Every array in your archive as a CSV.Each array gets its own header row and a column layout that matches its shape.
What you get
The conversion writes one CSV with a header row for each array in the archive, named after the array. The output can be one or more files.
A 1-D array becomes one column. A 2-D array becomes a table with a column for each index of its second axis, named 0, 1, 2 and so on.
Records and bigger arrays
A record array gets a column for each field. A field that holds an array or nested records is written as JSON text in its cell.
An array of three or more dimensions becomes one row for each index of all but its last axis. Those rows are led by columns named axis0, axis1 and so on.
How values are written
Numbers keep their shortest exact form. Booleans become true and false, and dates and times become ISO 8601.
NaN and NaT become empty cells. Infinities are written as inf and -inf.
Arrays of Python objects
Arrays of Python objects are not loaded, since unpickling them could run code. The conversion stops with
unsupported_elementswhen the archive holds one.To combine the results afterward, see merge CSV. For other targets, see every CSV conversion.
NPZ and CSV.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
CSV
Rows of comma-separated values. The plainest way to move a table between programs.
- Extensions
- .csv
- MIME type
- text
/csv - Kind
- Text and data
In your code.The same NPZ to CSV conversion through the API, for your app or your agent.
$ cv convert report.npz report/ --to csv$ cv convert report.npz report/ --to csvQuestions.What people ask about NPZ to CSV.
Each array gets a header row, and it is named after the array. The name is the one it had in the archive.
It becomes a table with a column for each index of its second axis. The columns are named 0, 1, 2 and so on.
NaN and NaT become empty cells. Infinities are written as inf and -inf.
The archive holds an array of Python objects. These are not loaded, because unpickling them could run code.