[Numpy-discussion] truth value of dtypes

2010-12-10 Thread Nils Becker
Hi, why is bool(np.dtype(np.float)) False ? I came across this when using this python idiom: def f(dtype=None): if not dtype: print 'using default dtype' If there is no good reason to have a False truth value, I would vote for making it True since that is what one would expect

[Numpy-discussion] status of date-times

2010-12-10 Thread Mark Bakker
Hello List, Can someone update us on the status of the date-times datatype? Is it working yet? If not, what are the plans? I really appreciate all the work and am looking forward to using the new date-times, Best regards, Mark ___ NumPy-Discussion

[Numpy-discussion] Numpy and Python3

2010-12-10 Thread Katharina
Hello everyone, first, I'm really apologise for my English-skills. But I have only one simple questions. Does NumPy work on Python3 now. I read so many articles on the Internet, but you can only read some speculation and not a clear state about this topic. At the moment I try numpy1.5.1 on

Re: [Numpy-discussion] Numpy and Python3

2010-12-10 Thread Ralf Gommers
On Fri, Dec 10, 2010 at 6:33 PM, Katharina ingwer.wur...@gmx.net wrote: Hello everyone, first, I'm really apologise for my English-skills. But I have only one simple questions. Does NumPy work on Python3 now. I read so many articles on the Internet, but you can only read some speculation

Re: [Numpy-discussion] truth value of dtypes

2010-12-10 Thread Robert Kern
On Fri, Dec 10, 2010 at 03:13, Nils Becker n.bec...@amolf.nl wrote: Hi, why is bool(np.dtype(np.float)) False ? I came across this when using this python idiom: def f(dtype=None): if not dtype: print 'using default dtype' The default truth value probably should be True,

Re: [Numpy-discussion] truth value of dtypes

2010-12-10 Thread Alan G Isaac
On 12/10/2010 4:13 AM, Nils Becker wrote: def f(dtype=None): if not dtype: I think you want: if dtype is None: fwiw, Alan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] Numpy and Python3

2010-12-10 Thread Charles R Harris
On Fri, Dec 10, 2010 at 3:33 AM, Katharina ingwer.wur...@gmx.net wrote: Hello everyone, first, I'm really apologise for my English-skills. But I have only one simple questions. Does NumPy work on Python3 now. I read so many articles on the Internet, but you can only read some speculation

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-10 Thread Keith Goodman
On Wed, Dec 1, 2010 at 6:07 PM, Keith Goodman kwgood...@gmail.com wrote: On Wed, Dec 1, 2010 at 5:53 PM, David da...@silveregg.co.jp wrote: On 12/02/2010 04:47 AM, Keith Goodman wrote: It's hard to write Cython code that can handle all dtypes and arbitrary number of dimensions. The former is

[Numpy-discussion] np.var() and ddof

2010-12-10 Thread Keith Goodman
Why does ddof=2 and ddof=3 give the same result? np.var([1, 2, 3], ddof=0) 0.3 np.var([1, 2, 3], ddof=1) 1.0 np.var([1, 2, 3], ddof=2) 2.0 np.var([1, 2, 3], ddof=3) 2.0 np.var([1, 2, 3], ddof=4) -2.0 I expected NaN for ddof=3.

Re: [Numpy-discussion] np.var() and ddof

2010-12-10 Thread josef . pktd
On Fri, Dec 10, 2010 at 4:42 PM, Keith Goodman kwgood...@gmail.com wrote: Why does ddof=2 and ddof=3 give the same result? np.var([1, 2, 3], ddof=0)   0.3 np.var([1, 2, 3], ddof=1)   1.0 np.var([1, 2, 3], ddof=2)   2.0 np.var([1, 2, 3], ddof=3)   2.0 np.var([1, 2, 3],

Re: [Numpy-discussion] np.var() and ddof

2010-12-10 Thread Keith Goodman
On Fri, Dec 10, 2010 at 2:26 PM, josef.p...@gmail.com wrote: On Fri, Dec 10, 2010 at 4:42 PM, Keith Goodman kwgood...@gmail.com wrote: Why does ddof=2 and ddof=3 give the same result? np.var([1, 2, 3], ddof=0)   0.3 np.var([1, 2, 3], ddof=1)   1.0 np.var([1, 2, 3], ddof=2)