More efficient array processing

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Thu Oct 23 18:21:02 EDT 2008


On Thu, 23 Oct 2008 13:56:22 -0700, John [H2O] wrote:

> I'm using zeros with type np.float, is there a way to define the data
> type to be 4 byte floats?

Yes:

In [13]: numpy.zeros(5, numpy.float32)
Out[13]: array([ 0.,  0.,  0.,  0.,  0.], dtype=float32)

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list