[Numpy-discussion] Question about np.savez

Pauli Virtanen pav at iki.fi
Tue Sep 1 09:08:32 EDT 2009


Tue, 01 Sep 2009 12:07:36 +0000, jorgesmbox-ml kirjoitti:
> I know the documentation states that np.savez saves numpy arrays, so my
> question relates to misusing it. Before reading the doc in detail, and
> after reading about pickle and other options to make data persistent, I
> passed np.savez a list of ndarrays. It didn't complain, but when I
> loaded the data back, the list had been turned into an ndarray. Is this
> behaviour expected? It did surprise me. Below  there is an example:
[clip]

It is expected. savez casts its input to arrays before saving.

-- 
Pauli Virtanen




More information about the NumPy-Discussion mailing list