[Numpy-discussion] Question about np.savez

Pauli Virtanen pav@iki...
Tue Sep 1 08:08:32 CDT 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:

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

Pauli Virtanen

More information about the NumPy-Discussion mailing list