scipy 0.5.2, in scipy.sparse.lil_matrix.__mul__: the optimization for
when multiplying by zero scalar is flawed. A copy of the original
matrix is returned, rather than the correct zero matrix. Nasty bug
because it only manifests itself with special input (zero scalar),
took me some time to nail my
On Wed, May 02, 2007 at 12:38:12AM +0200, Guillem Borrell i Nogueras wrote:
> lapack.argtypes=[c_int,c_int,
> ndpointer(dtype=float64,
>ndim=2,
>flags='FORTRAN'),
> c_int,c_int,
>
Hi Guillem
On Wed, May 02, 2007 at 12:38:12AM +0200, Guillem Borrell i Nogueras wrote:
> I wrote the next function just to learn how ctypes work with numpy arrays. I
> am not trying to write yet another wrapper to lapack, it's just an
> experiment. (you can cut and paste the code)
>
> from cty
Hi
I wrote the next function just to learn how ctypes work with numpy arrays. I
am not trying to write yet another wrapper to lapack, it's just an
experiment. (you can cut and paste the code)
from ctypes import c_int
from numpy import array,float64
from numpy.ctypeslib import load_library,ndpo
On Tue, May 01, 2007 at 12:05:20PM -, Simon Berube wrote:
> Alternatively, as a hackjob type check you could also do an
> "isinstance" check on the first element of the array since, unlike
> lists, arrays have uniform elements all the way through.
Or use
N.issubdtype(x.dtype,int) and N.issu
On 5/1/07, Mark.Miller <[EMAIL PROTECTED]> wrote:
OK...so just for future reference...does a Numpy 'long' not directly
correspond to a Python 'long'?
No. A numpy long corresponds, more or less, to the C long long int.
In [2]: array([1],dtype=long)
Out[2]: array([1], dtype=int64)
Chuck
Mark.Miller wrote:
> OK...so just for future reference...does a Numpy 'long' not directly
> correspond to a Python 'long'?
There is no Numpy "long", per se. There is a numpy.long symbol exposed, but it
is just the builtin long type. However, numpy has no special support for
Python's unbounded lon
OK...so just for future reference...does a Numpy 'long' not directly
correspond to a Python 'long'?
Robert Kern wrote:
> Mark.Miller wrote:
>> Can someone explain this? I can't seem to coerce numpy into storing
>> large integer values. I'm sure that I'm just overlooking something
>> simple...
Mark.Miller wrote:
> Can someone explain this? I can't seem to coerce numpy into storing
> large integer values. I'm sure that I'm just overlooking something
> simple...
>
>
> >>> import numpy
> >>> a='1'*300
> >>> type(a)
>
> >>> b=int(a)
> >>> type(b)
>
> >>> c=numpy.empty((2,2),lon
Can someone explain this? I can't seem to coerce numpy into storing
large integer values. I'm sure that I'm just overlooking something
simple...
>>> import numpy
>>> a='1'*300
>>> type(a)
>>> b=int(a)
>>> type(b)
>>> c=numpy.empty((2,2),long)
>>> c[:]=b
Traceback (most recent call la
When using numpy array the type of the array is given by the "dtype"
variable of the array. So if your array is int then array.dtype will
be 'int32'. Numpy uses more complex data types then just int and
floats so you might want to check all the available data types.
Ex:
In [168]: a = array([1,2,3
11 matches
Mail list logo