Re: [Numpy-discussion] printing array in tabular form

2013-05-10 Thread Jonathan Slavin
Sudheer, This is not really numpy specific. There are many options for output formatting in python. For the specific question you have, you could do: print '{0}{1:8.3f}{2:8.3f}{3:8.3f}{4:8.3f}{5:8.3f}'.format(s,x1,x2,x3,x4,x5) format is a built-in python string method (see python docs). The on

[Numpy-discussion] clip with None argument changes dtype

2013-05-01 Thread Jonathan Slavin
Hi all, I'm wondering if you think the following behavior in numpy.clip is a bug (it certainly confused me for a while): >>> x = np.arange(5.) >>> xx = x.clip(None,3.) >>> xx array([0.0, 1.0, 2.0, 3.0, 3.0], dtype=object) Since xx now has the dtype of object, doing things like >>> np.exp(xx) Attri

[Numpy-discussion] f2py and object libraries

2013-04-25 Thread Jonathan Slavin
Hi all, I have recently started using f2py to access some legacy fortran code and it's mostly worked better than I expected. It handles common blocks, block data, etc. with no problems. I did need to define the type of all the arguments in subroutine and function calls, but not in the body of th