Re: [Numpy-discussion] Fancy indexing with masks

2011-09-22 Thread Han Genuit
2011/9/20 Stéfan van der Walt ste...@sun.ac.za

 On Tue, Sep 20, 2011 at 12:43 AM, Robert Kern robert.k...@gmail.com
 wrote:
  If the array is short in a dimension, it gets implicitly continued
  with Falses. You can see this in one dimension:

 [...]

  I honestly don't know if this is documented or tested anywhere or even
  if this existed in older versions.

 The behaviour is already present in 1.4, so I guess it's too late to
 insert a shape check now?

 There already is a shape check present in the development version[1]:

 a = np.arange(10)
 b = np.array([False, True, False])
 a[b]
Traceback (most recent call last):
  File stdin, line 1, in module
ValueError: operands could not be broadcast together with shapes (10) (3)

But it does not seem to work on multidimensional arrays:

 c = np.arange(12).reshape((4,3))
 c[b]
array([[3, 4, 5]])

I also noticed that it does strange things when using a list:

 c[[True, False, True]]
array([[3, 4, 5],
   [0, 1, 2],
   [3, 4, 5]])

Regards,
Han

[1] See also:
http://mail.scipy.org/pipermail/numpy-discussion/2011-July/057870.html
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Fancy indexing with masks

2011-09-22 Thread Pauli Virtanen
Thu, 22 Sep 2011 08:12:12 +0200, Han Genuit wrote:
[clip]
 I also noticed that it does strange things when using a list:
 
 c[[True, False, True]]
 array([[3, 4, 5],
[0, 1, 2],
[3, 4, 5]])

It casts the list with booleans to an integer array. Probably shouldn't 
work like that...

Pauli

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] ImportError: libptf77blas.so.3: cannot open shared object file: No such file or directory

2011-09-22 Thread Marijn Verkerk
Dear all,

Maybe someone has experienced this problem before.

I was able to build and install numpy in a seperate python 2.7 folder on 
our cluster. When I try to import numpy I get the following error:


$ /software/Python-2.7.2/bin/python -c 'import numpy; numpy.test()'
Traceback (most recent call last):
   File string, line 1, in module
   File 
/illumina/software/Python-2.7.2/lib/python2.7/site-packages/numpy/__init__.py,
 
line 137, in module
 import add_newdocs
   File 
/illumina/software/Python-2.7.2/lib/python2.7/site-packages/numpy/add_newdocs.py,
 
line 9, in module
 from numpy.lib import add_newdoc
   File 
/illumina/software/Python-2.7.2/lib/python2.7/site-packages/numpy/lib/__init__.py,
 
line 13, in module
 from polynomial import *
   File 
/illumina/software/Python-2.7.2/lib/python2.7/site-packages/numpy/lib/polynomial.py,
 
line 17, in module
 from numpy.linalg import eigvals, lstsq
   File 
/illumina/software/Python-2.7.2/lib/python2.7/site-packages/numpy/linalg/__init__.py,
 
line 48, in module
 from linalg import *
   File 
/illumina/software/Python-2.7.2/lib/python2.7/site-packages/numpy/linalg/linalg.py,
 
line 23, in module
 from numpy.linalg import lapack_lite
ImportError: libptf77blas.so.3: cannot open shared object file: No such 
file or directory


In the __config.py file the folder where libptf77 should be is present.

Any suggestions?

Regards,
Marijn
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] ImportError: libptf77blas.so.3: cannot open shared object file: No such file or directory

2011-09-22 Thread Pauli Virtanen
Hi,

Thu, 22 Sep 2011 13:09:51 +0200, Marijn Verkerk wrote:
[clip]
 ImportError: libptf77blas.so.3: cannot open shared object file: No such
 file or directory
 
 In the __config.py file the folder where libptf77 should be is present.
 
 Any suggestions?

You need to make the dynamic linker able to find this file, e.g., by
setting the LD_LIBRARY_PATH environment variable to a correct value. Test 
with ldd lapack_lite.so (The stuff in __config.py is unrelated.)

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Debug memory block at address p=0x2ba5928: API 'm'

2011-09-22 Thread Sandro Tosi
Hello,
I'm running tests for numpy 1.6.1 on 2.7 -dbg flavor and I got this:

.Debug memory block at address p=0x2ba5928: API 'm'
8 bytes originally requested
The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected.
The 8 pad bytes at tail=0x2ba5930 are FORBIDDENBYTE, as expected.
The block was made by call #1253108 to debug malloc/realloc.
Data at p: a3 03 00 00 00 00 00 00
Fatal Python error: bad ID: Allocated using API 'm', verified using API 'o'
Running unit tests for numpy
NumPy version 1.6.1

and it got aborted.

Running the tests with 2.6-dbg doesn't show this behavior. How can I
help you debug it?

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Debug memory block at address p=0x2ba5928: API 'm'

2011-09-22 Thread Bruce Southey
On 09/22/2011 02:44 PM, Sandro Tosi wrote:
 Hello,
 I'm running tests for numpy 1.6.1 on 2.7 -dbg flavor and I got this:

 .Debug memory block at address p=0x2ba5928: API 'm'
  8 bytes originally requested
  The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected.
  The 8 pad bytes at tail=0x2ba5930 are FORBIDDENBYTE, as expected.
  The block was made by call #1253108 to debug malloc/realloc.
  Data at p: a3 03 00 00 00 00 00 00
 Fatal Python error: bad ID: Allocated using API 'm', verified using API 'o'
 Running unit tests for numpy
 NumPy version 1.6.1

 and it got aborted.

 Running the tests with 2.6-dbg doesn't show this behavior. How can I
 help you debug it?

 Cheers,
All that I can tell you is that this is Ticket 1578:
http://projects.scipy.org/numpy/ticket/1578

Bruce
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Debug memory block at address p=0x2ba5928: API 'm'

2011-09-22 Thread Sandro Tosi
On Thu, Sep 22, 2011 at 21:49, Bruce Southey bsout...@gmail.com wrote:
 All that I can tell you is that this is Ticket 1578:
 http://projects.scipy.org/numpy/ticket/1578

Ah, I could have probably checked it before sending this email, but
now that webpage gives me 500 - it's spreading! :)

-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion