[Numpy-discussion] Some help on matlab to numpy translation

2010-03-13 Thread Nicolas Rougier
Hello, I'm trying to translate a small matlab program for the simulation in a 2D flow in a channel past a cylinder and since I do not have matlab access, I would like to know if someone can help me, especially on array indexing. The matlab source code is available at:

Re: [Numpy-discussion] Some help on matlab to numpy translation

2010-03-13 Thread Fabrice Silva
Le samedi 13 mars 2010 à 10:20 +0100, Nicolas Rougier a écrit : Hello, I'm trying to translate a small matlab program for the simulation in a 2D flow in a channel past a cylinder and since I do not have matlab access, I would like to know if someone can help me, especially on array indexing.

Re: [Numpy-discussion] Some help on matlab to numpy translation

2010-03-13 Thread Nicolas Rougier
Thanks. I agree that the use of ':' is a bit weird. Nicolas On Mar 13, 2010, at 11:45 , Fabrice Silva wrote: Le samedi 13 mars 2010 à 10:20 +0100, Nicolas Rougier a écrit : Hello, I'm trying to translate a small matlab program for the simulation in a 2D flow in a channel past a cylinder

Re: [Numpy-discussion] Some help on matlab to numpy translation

2010-03-13 Thread Ryan May
On Sat, Mar 13, 2010 at 4:45 AM, Fabrice Silva si...@lma.cnrs-mrs.fr wrote: Le samedi 13 mars 2010 à 10:20 +0100, Nicolas Rougier a écrit : Hello, I'm trying to translate a small matlab program for the simulation in a 2D flow in a channel past a cylinder and since I do not have matlab access,

Re: [Numpy-discussion] Some help on matlab to numpy translation

2010-03-13 Thread Friedrich Romstedt
2010/3/13 Nicolas Rougier nicolas.roug...@loria.fr: I'm trying to translate a small matlab program for the simulation in a 2D flow in a channel past a cylinder and since I do not have matlab access, I would like to know if someone can help me, especially on array indexing. The matlab source

Re: [Numpy-discussion] Some help on matlab to numpy translation

2010-03-13 Thread Fabrice Silva
As ux 's shape is (1,lx,ly), ux(:,1,col) is equal to ux(1,1,col) which is a vector with the elements [ux(1,1,2), ... ux(1,1,ly-1)]. Using : juste after the reshape seems a lit bit silly... Except that python uses 0-based indexing and does not include the last number in a slice, while

[Numpy-discussion] problem with applying patch

2010-03-13 Thread z99719 z99719
I have installed latest numpy from svn on ubuntu karmic(9.10) and compiled the code in my sand box. I downloaded two patches (test_umath_complex.py.patch, build_clib.py.patch) from the review patch directory on http://projects.scipy.org/numpy/report/12 page for testing. The following patch command

Re: [Numpy-discussion] problem with applying patch

2010-03-13 Thread Pauli Virtanen
Sat, 13 Mar 2010 12:06:24 -0700, z99719 z99719 wrote: [clip] The patch files are placed in the top level numpy sandbox directory and are in xml format rather than a diff file. I used save link as on the link to download the patch on the Attachments section of the link page. That gives you the

[Numpy-discussion] integer division rule?

2010-03-13 Thread Alan G Isaac
Francesc Altet once provided an example that for integer division, numpy uses the C99 rule: round towards 0. This is different than Python's rule for integer division: round towards negative infinity. But I cannot reproduce his example. (NumPy 1.3.) Did this behavior change at some point?

[Numpy-discussion] long integers in genfromtxt

2010-03-13 Thread josef . pktd
I was trying to find out what the helpful message TypeError: expected a readable buffer object means and it seems genfromtxt has problems identifying long integers (at least on Windows 32) np.array(416068,int) Traceback (most recent call last): File pyshell#4, line 1, in module

Re: [Numpy-discussion] integer division rule?

2010-03-13 Thread Pauli Virtanen
la, 2010-03-13 kello 15:32 -0500, Alan G Isaac kirjoitti: Francesc Altet once provided an example that for integer division, numpy uses the C99 rule: round towards 0. This is different than Python's rule for integer division: round towards negative infinity. But I cannot reproduce his

Re: [Numpy-discussion] integer division rule?

2010-03-13 Thread Charles R Harris
On Sat, Mar 13, 2010 at 3:04 PM, Pauli Virtanen p...@iki.fi wrote: la, 2010-03-13 kello 15:32 -0500, Alan G Isaac kirjoitti: Francesc Altet once provided an example that for integer division, numpy uses the C99 rule: round towards 0. This is different than Python's rule for integer