reshape() no funciona en mi máquina
Raziel
razielmine en gmail.com
Jue Nov 16 09:25:20 CET 2006
Estoy intentando utilizar reshape() (del módulo Numeric) en mi
Gentoo en amd64, y siempre me suelta errores absurdos. Por ejemplo:
Python 2.4.3 (#1, Nov 15 2006, 18:27:32)
[GCC 4.1.1 (Gentoo 4.1.1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Numeric import *
>>> a = array([1,2,3,4,5,6])
>>> reshape(a, (3,2))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: total size of new array must be unchanged
>>> reshape(a, (6,))
array([1, 2, 3, 4, 5, 6])
>>> reshape(a, (6,1))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: total size of new array must be unchanged
>>> reshape(a, (1,6))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: total size of new array must be unchanged
>>> reshape(a, (6,))
array([1, 2, 3, 4, 5, 6])
>>>
Si intento ejecutar lo mismo en los ordenadores de la facultad
(Ubuntu en x86), funciona como era de esperar:
Python 2.4.3 (#2, Oct 6 2006, 07:52:30)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Numeric import *
>>> a = array([1,2,3,4,5,6])
>>> reshape(a, (3,2))
array([[1, 2],
[3, 4],
[5, 6]])
>>> reshape(a, (6,))
array([1, 2, 3, 4, 5, 6])
>>> reshape(a, (6,1))
array([[1],
[2],
[3],
[4],
[5],
[6]])
>>> reshape(a, (1,6))
array([ [1, 2, 3, 4, 5, 6]])
>>> reshape(a, (6,))
array([1, 2, 3, 4, 5, 6])
>>>
Tenéis idea de cuál puede ser el problema? Versión de GCC?
Arquitectura? Es un bug conocido? Alguna forma de evitarlo?
------------ próxima parte ------------
_______________________________________________
Python-es mailing list
Python-es en aditel.org
http://listas.aditel.org/listinfo/python-es
Más información sobre la lista de distribución Python-es