Dear all,
I am having a few issues with indexing in numpy and wondered if you could help
me out.
If I define an array
a = zeros(( 4))
a
array([ 0., 0., 0., 0.])
Then I try and reference a point beyond the bounds of the array
a[4]
Traceback (most recent call last):
File "", line 1, in
IndexE
mple of a function prototype you are wrapping, the %apply directive you
> use and and example of python code accessing it?
>
> -Bill
>
> From: numpy-discussion-boun...@scipy.org [numpy-discussion-boun...@scipy.org]
> On Behalf Of Rich E [
Hi all,
I have a SWIG wrapped C library that uses 32bit floating point arrays,
using the numpy.i typemapping system for passing the arrays. For
every array that I make, I have to convert it using astype('float32'),
else python complains that I tried to pass a double-precision array.
Is there any
n my XP/cygwin/mingw32 system, so it could need some tuning on a
> different system!
>
> In all this, not sure where is best to put the %exception statement, but
> placement shouldn't be critical, because it concerns the my_ function rather
> than the original (or renamed) sms_ functio
t; $ swig -version
>
> SWIG Version 1.3.36
>
> Compiled with g++ [i686-pc-cygwin]
> Please see http://www.swig.org for reporting bugs and further information
>
>
>
>
> On Thu, Jan 8, 2009 at 1:43 AM, Rich E wrote:
>>
>> Here is my example, trying to wrap the fun
58 AM, Matthieu Brucher
wrote:
> 2009/1/6 Rich E :
>> This helped immensely. I feel like I am getting close to being able
>> to accomplish what I would like with SWIG: producing a python module
>> that can be very 'python-like', while co-existing with the c library
>
ray: [1, 1, 2, 2, 3, 3, 4, 4]
> result: [ 1.41421354 2.82842708 4.2426405 5.65685415]
>
> array: [1, 1, 2]
> result:
> Traceback (most recent call last):
> File "test_dftmagnitude.py", line 15, in
> print "result:",dftmagnitude.spectrumMag(a)
> Ind
it all makes sense. If you have any questions, don't hesitate!
>
>>python test_dftmagnitude.py
> [1, 1, 2, 2]
> [ 1.41421354 2.82842708]
> [1, 1, 2, 2, 3, 3, 4, 4]
> [ 1.41421354 2.82842708 4.2426405 5.65685415]
> [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]
> [ 1.41421354 2.8
Hi list,
My question has to do with the Numpy/SWIG typemapping system.
I recently got the typemaps in numpy.i to work on most of my C
functions that are wrapped using SWIG, if they have arguments of the
form (int sizeArray, float *pArray).
Now I am trying to figure out how to wrap function that