Re: [Numpy-discussion] Short-hand array creation in `numpy.mat` style

2014-07-18 Thread Charles G. Waldman
Martinot-Lagarde wrote: > Le 18/07/2014 20:42, Charles G. Waldman a écrit : >> Well, if the goal is "shorthand", typing numpy.array(numpy.mat()) >> won't please many users. >> >> But the more I think about it, the less I think Numpy should support >>

Re: [Numpy-discussion] Short-hand array creation in `numpy.mat` style

2014-07-18 Thread Charles G. Waldman
Well, if the goal is "shorthand", typing numpy.array(numpy.mat()) won't please many users. But the more I think about it, the less I think Numpy should support this (non-Pythonic) input mode. Too much molly-coddling of new users! When doing interactive work I usually just type: >>> np.array([[1,

Re: [Numpy-discussion] Short-hand array creation in `numpy.mat` style

2014-07-18 Thread Charles G. Waldman
I greatly prefer "np.mat" to "np.arr" for this, FWIW On Fri, Jul 18, 2014 at 3:37 AM, Nathaniel Smith wrote: > On Thu, Jul 17, 2014 at 11:10 PM, Charles G. Waldman > wrote: >> >> -1 on the 'arr' name. I think if we're going to support t

Re: [Numpy-discussion] Short-hand array creation in `numpy.mat` style

2014-07-18 Thread Charles G. Waldman
-1 on the 'arr' name. I think if we're going to support this function at all (which I'm not convinced is a good idea), it should be np.fromsomething like the other from* functions. Maybe frommatlab? I think that 'arr' is just too generic and too close to 'array'. On Tue, Jul 15, 2014 at 3:5

[Numpy-discussion] bug with mmap'ed datetime64 arrays

2014-02-17 Thread Charles G. Waldman
test case: #!/usr/bin/env python import numpy as np a=np.array(['2014', '2015', '2016'], dtype='datetime64') x=np.datetime64('2015') print a>x np.save('test.npy', a) b = np.load('test.npy', mmap_mode='c') print b>x result: >>> [False False True] Traceback (most recent call last): File "", li

[Numpy-discussion] bool value of dtype is False?

2014-02-14 Thread Charles G. Waldman
>>> d = numpy.dtype(int) >>> if d: print "OK" ... else: print "I'm surprised" I'm surprised ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] bug in comparing object arrays to None (?)

2014-01-27 Thread Charles G. Waldman
Hi Numpy folks. I just noticed that comparing an array of type 'object' to None does not behave as I expected. Is this a feature or a bug? (I can take a stab at fixing it if it's a bug, as I believe it is). >>> np.version.full_version '1.8.0' >>> a = np.array(['Frank', None, 'Nancy']) >>> a a

Re: [Numpy-discussion] building 32 bit numpy on 64 bit linux

2013-12-13 Thread Charles G. Waldman
>>> this might work: >>> >>> CC="gcc -m32" LDSHARED="gcc -m32" FF="gfortran -m32" linux32 python >>> setup.py build Compiler flags can't be added to CC, they should be in CFLAGS. (and ld flags go into LDFLAGS). Otherwise you are saying to use a program called "gcc -m32" (with a space in the name

[Numpy-discussion] numpy datetime64 NaT string conversion bug & patch

2013-11-27 Thread Charles G. Waldman
If you convert an array of strings to datetime64s and 'NaT' (or one of its variants) appears in the string, all subsequent values are rendered as NaT: (this is in 1.7.1 but the problem is present in current dev version as well) >>> import numpy as np >>> a = np.array(['2010', 'nat', '2030']) >>>