[Numpy-discussion] switching to float32
Thu Jun 25 10:40:47 CDT 2009
This does not exactly answer your question, but you can use the dtype
string representation and positional parameter to make things nicer.
a = numpy.array( [1.0, 2.0, 3.0], 'f' )
a = numpy.array( [1.0, 2.0, 3.0], dtype=numpy.float32 )
On Jun 25, 2009, at 6:43 AM, John Schulman wrote:
> I'm trying to reduce the memory used in a calculation, so I'd like to
> switch my program to float32 instead of float64. Is it possible to
> change the numpy default float size, so I don't have to explicitly
> state dtype=np.float32 everywhere?
> Numpy-discussion mailing list
More information about the Numpy-discussion