[Numpy-discussion] switching to float32

2009-06-25 Thread John Schulman
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? Thanks, John

Re: [Numpy-discussion] switching to float32

2009-06-25 Thread Geoffrey Ely
This does not exactly answer your question, but you can use the dtype string representation and positional parameter to make things nicer. For example: a = numpy.array( [1.0, 2.0, 3.0], 'f' ) instead of a = numpy.array( [1.0, 2.0, 3.0], dtype=numpy.float32 ) -Geoff On Jun 25, 2009, at

Re: [Numpy-discussion] loading data

2009-06-25 Thread Anne Archibald
2009/6/25 Mag Gam magaw...@gmail.com: Hello. I am very new to NumPy and Python. We are doing some research in our Physics lab and we need to store massive amounts of data (100GB daily). I therefore, am going to use hdf5 and h5py. The problem is I am using np.loadtxt() to create my array and

Re: [Numpy-discussion] loading data

2009-06-25 Thread Neil Martinsen-Burrell
On Thu, June 25, 2009 7:59 pm, Mag Gam wrote: I am very new to NumPy and Python. We are doing some research in our Physics lab and we need to store massive amounts of data (100GB daily). I therefore, am going to use hdf5 and h5py. The problem is I am using np.loadtxt() to create my array and