Convert NPY to CSV
Turn NPY files into CSV. The array as comma-separated values with a header row.
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 a CSV table.Every value is written as text, with a header row on top.
What you get
One CSV file with a header row. 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.
A record array gets a column for each field. A field that holds an array or nested records is written as JSON text.
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. Dates and times become ISO 8601.
NaN and NaT become empty cells. Infinities become inf and -inf.
Object arrays
Arrays of Python objects are not loaded, since unpickling them could run code. The conversion stops with
unsupported_elementswhen the file holds one.To combine several resulting tables, see merge CSV. For other targets, see every CSV conversion.
NPY and CSV.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
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 NPY to CSV conversion through the API, for your app or your agent.
$ cv convert report.npy report.csv$ cv convert report.npy report.csvQuestions.What people ask about NPY to CSV.
Each row of the array becomes a row in the CSV. The columns are named 0, 1, 2 and so on, one for each index of the second axis.
NaN becomes an empty cell. NaT is written the same way, and infinities are written as inf and -inf.
Yes. It becomes one row for each index of all but the last axis, led by columns named axis0, axis1 and so on.
The array holds Python objects. These are not loaded, because unpickling them could run code.