[Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-03 Thread Hanni Ali
Hi, I have encountered a worrying problem, during migration of software from numarray to numpy, perhaps someone could help me determine how this could be addressed. I have a large array or values 1 long 12 items per line. The matrix contains floats, dtype=float32 in numpy and type=Float32 in

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-03 Thread Hanni Ali
g to > do with the quality of the computation. Numpy only prints a part of a > float value, but fir the computations, it obviously uses the correct > value. All this can be parametrized by using set_printoptions(). > > Matthieu > > 2008/9/3, Hanni Ali <[EMAIL PROTECTED]>: >

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-03 Thread Hanni Ali
5], [ 0.41582015, 0.41582015, 0.41582015, 0.41582015, 0.41582015, 0.41582015, 0.41582015, 0.41582015, 0.41582015, 0.41582015]], type=Float32) >>> matrix.mean() 0.41582015156745911 2008/9/3 David Cournapeau <[EMAIL PROTECTED]> > Hanni Ali wrote: >

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-03 Thread Hanni Ali
Sebastian you legend, that seems to be it. Thank you very much. >>> matrix.mean(dtype='float64') 0.41582015156745911 What seems odd is that numpy doesn't do this on it's own... 2008/9/3 Sebastian Stephan Berg <[EMAIL PROTECTED]> > Hi, > > just guessing here. But numarray seems to calculate t

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-03 Thread Hanni Ali
Also can you think of a way either dtype is always float64? I have a lot of functions and to add dtype='float64' would require *loads* of testing, whereas if I can set it centrally on the matrix or in the environment that would be so much easier. Hanni 2008/9/3 Hanni Ali <[EM

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-03 Thread Hanni Ali
think, you can encounter bugs. Least surprise is always > better ;) > > Matthieu > > 2008/9/3, Hanni Ali <[EMAIL PROTECTED]>: > > Sebastian you legend, that seems to be it. > > > > Thank you very much. > > > > >>> matrix.mean(dtype='float64&#

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-03 Thread Hanni Ali
Oh ok, I shall have to find where I did that then. Thanks 2008/9/3 Matthieu Brucher <[EMAIL PROTECTED]> > By default, numpy uses float64, but you told it to use float32 ;) > > Matthieu > > 2008/9/3, Hanni Ali <[EMAIL PROTECTED]>: > > Also can you think of a way

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-03 Thread Hanni Ali
We used to care about memory when we were running on 32-bit platforms, but with the move to 64-bit, enabled by the current work, the issue is removed and I will probably be changing everything for more accuracy. Thanks Hanni 2008/9/3 David Cournapeau <[EMAIL PROTECTED]> > Hanni

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-04 Thread Hanni Ali
Hi, Is there a way I can set numpy to use dtype='float64' throughout all my code or force it to use the biggest datatype without adding the dtype='float64' to every call to mean, stdev etc.. 2008/9/3 Sebastian Stephan Berg <[EMAIL PROTECTED]> > Hi, > > just guessing here. But numarray seems to

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-08 Thread Hanni Ali
.=200,000.0 not 2array.sum() != 200,000... Just an opinion though Hanni 2008/9/4 David Cournapeau <[EMAIL PROTECTED]> > Hanni Ali wrote: > > Hi, > > > > Is there a way I can set numpy to use dtype='float64' throughout all > > my code or force it to use the

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-09 Thread Hanni Ali
Hi Matthieu, Interesting example thanks. I can't however seem to get anything other than zero for the 100,000 to 1 sum. Cheers, Hanni 2008/9/9 Matthieu Brucher <[EMAIL PROTECTED]> > > I now have a distinct dislike of float values (it'll probably wear off > over > > time), how can the sum of 10

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-09 Thread Hanni Ali
> > > I think it is a fallacy to say you prefer accuracy over speed: the > fallacy is in thinking it is binary choice. You care about speed, > because otherwise, you would not use a computer at all, you would do > everything by hand [1]. Floating point is by itself an approximation: it > can not ev

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-09 Thread Hanni Ali
I already was... 2008/9/9 Matthieu Brucher <[EMAIL PROTECTED]> > Use 1./n instead of 1/n. If n is an integer, 1/n equals 0. > > Matthieu > > 2008/9/9 Hanni Ali <[EMAIL PROTECTED]>: > > Hi Matthieu, > > > > Interesting example thanks. I can't howe

Re: [Numpy-discussion] cannot find numpy 1.2 for python 2.6 on window

2008-10-05 Thread Hanni Ali
Hi Alan, I've been using numpy with 2.6 on amd64 for about 3 months no problem and far more stable on 64-bit than the same combination with 2.5. Daniel, just download the source and compile it yourself. You need to use VS 9.0 for best compatibility with Python and I haven't yet sorted out fast bl

Re: [Numpy-discussion] cannot find numpy 1.2 for python 2.6 on window

2008-10-05 Thread Hanni Ali
Hi David, Yeah nose was an issue, thanks for letting me know about nose compatibility being sorted that's good news as I use it a bit with my testing. I last built 1.1.1 with express for 32bit it went fine (although I think you do have to comment out , I was also able to compile with 2008 full fo

Re: [Numpy-discussion] can't build numpy 1.2.0 under python 2.6 (windows-amd64) using VS9

2008-10-08 Thread Hanni Ali
Just to note, on the compilation issue, I encountered this a while ago with numpy 1.1.1 and I think Python 2.6b2, again because we wanted to skip Python 2.5 in my organization, largely because it was an issue to get working on 64-bit. I couldn't find anywhere 7.1 was available. We discussed errors

Re: [Numpy-discussion] can't build numpy 1.2.0 under python 2.6 (windows-amd64) using VS9

2008-11-20 Thread Hanni Ali
Hi All, I have reached the point where I really need to get some sort of optimised/accelerated BLAS/LAPACK for windows 64 so have been trying a few different things out to see whether I can get anything usable, today i stumbled across this: http://icl.cs.utk.edu/lapack-for-windows/index.html Has

[Numpy-discussion] Building numpy on Windows 64-bit BLAS/LAPACK

2008-11-21 Thread Hanni Ali
Hi, I have spent some time trying to use different methods to build numpyon Windows 64bit with a version of BLAS/LAPACK other than the inbuilt one (no slur on the inbuilt one it is excellent, I am simply attempting to see if there is any alternative with better performance). The most recent i have

[Numpy-discussion] Importance of order when summing values in an array

2008-12-09 Thread Hanni Ali
Hi All, I have encountered a puzzling issue and I am not certain if this is a mistake of my own doing or not. Would someone kindly just look over this issue to make sure I'm not doing something very silly. So, why would the sum of an array have a different value depending on the order I select th

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Hanni Ali
ה מקורית- > מאת: [EMAIL PROTECTED] בשם Hanni Ali > נשלח: ג 09-דצמבר-08 16:07 > אל: Discussion of Numerical Python > נושא: [Numpy-discussion] Importance of order when summing values in anarray > > Hi All, > > I have encountered a puzzling issue and I am not certain i

Re: [Numpy-discussion] Importance of order when summing values in anarray

2008-12-09 Thread Hanni Ali
Hi Bruce, Ahh, but I would have thought the precision for the array operation would be the same no matter which values I wish to sum? The array is in float64 in all cases. I would not have thought altering the type of the integer values would make any difference as these indices are all below 5 m

Re: [Numpy-discussion] python numpy code many times slower than c++

2009-01-21 Thread Hanni Ali
I have been using your profiler extensively and it has contributed to my achieving significant improvements in the application I work on largely due to the usefulness of the line by line breakdown enabling me to easily select the next part of code to work on optimizing. So firstly many thanks for w

[Numpy-discussion] List of Lists in C

2009-01-26 Thread Hanni Ali
Hi, Quick question, I've been doing a fair bit of extension writing in C recently, but wondered how best to implement: >>> l = [[]] * 5 to create a list of a given length containing the initialization variable desired. A loop seems the straight forward manner, but I would have thought there was

Re: [Numpy-discussion] List of Lists in C

2009-01-26 Thread Hanni Ali
e list in each element of the > outer list. If you don't want this, use [[] for i in range(5)]. I > don't think there is another way in C either (or too complicated). > > Matthieu > > 2009/1/26 Hanni Ali : > > Hi, > > > > Quick question, I've been d

Re: [Numpy-discussion] List of Lists in C

2009-01-26 Thread Hanni Ali
Correct, however other areas of the application expect an empty list to be present, otherwise I would have used None. 2009/1/26 Matthieu Brucher > 2009/1/26 Hanni Ali : > > Yes fair point, but when it's a empty list and new elements are replaced > > with a new lis

[Numpy-discussion] PyArray_Zeros

2009-01-27 Thread Hanni Ali
Hi, I have been having trouble with the PyArray_Zeros/PyArray_ZEROS functions. I cannot seem to create an array using these functions. resultArray = PyArray_ZEROS(otherArray->nd, otherArray->dimensions, NPY_DOUBLE, 0); I would have thought this would have created an array the same shape as the o

Re: [Numpy-discussion] Building on WinXP 64-bit, Intel Compilers

2009-01-30 Thread Hanni Ali
I have been meaning to chip in but so far hadn't got to it so hear goes. In response to this particular issue I currently use numpy (1.2.1) built with msvc VS 2008 by simply commenting out these definitions in the numpy\core\src\umathmodule.c.src That works just fine and allows me to use the buil

Re: [Numpy-discussion] Building on WinXP 64-bit, Intel Compilers

2009-02-02 Thread Hanni Ali
Hi David, I used free trials of the Intel and PGI compilers to try to compile an external BLAS/LAPACK in conjunction with VS 2008. I also had no problems getting the C code to compile, but couldn't get linking to work succesfully with fortran stuff. I would not be surprised if we could get a licen

Re: [Numpy-discussion] PyArray_SETITEM with object arrays in Cython

2009-02-11 Thread Hanni Ali
Hi Wes, I do not profess to be an expert, but I have been off loading a fair number of loops to C from Python code and achieved significant improvements most have been of the following form (which I have found to be the fastest): size = *incomingArrayObj->dimensions; r_dptr = PyArray_DATA(result

Re: [Numpy-discussion] 64-bit numpy questions?

2009-03-03 Thread Hanni Ali
> > Is anyone using numpy in 64-bit environments on a day-to-day basis? Windows 2003 64 >Are you using very large arrays, i.e. over 2G in size? Yes without any problems, using Python 2.6. Hanni ___ Numpy-discussion mailing list Numpy-discussio

Re: [Numpy-discussion] Code for compatibility with gfortran, license issues

2009-06-29 Thread Hanni Ali
Hi David, Sounds very interesting, have you noticed any improvement in performance ove using the builtin numpy blas lite? If you need someone to test on Windows 64 I would be happy to do so. Hanni 2009/6/29 David Cournapeau > Hi, > >I started working on a new approach for windows 64 bits

Re: [Numpy-discussion] Installation info

2008-05-30 Thread Hanni Ali
I would also like to see a 64bit build for windows as well if possible. Hanni 2008/5/30 Peter Creasey <[EMAIL PROTECTED]>: > 2008/5/30 Peter Creasey <[EMAIL PROTECTED]>: > > Is numpy v1.1 going to come out in egg format? > > > > Oops, I didn't mean to mail with an entire numpy digest in the body

Re: [Numpy-discussion] Installation info

2008-06-02 Thread Hanni Ali
Hi David, > Unfortunately, this is difficult: windows 64 is not commonly available > (I don't have any access to it personally, for example), and mingw is > not available yet for windows 64 either. I had managed to compile and install 1.04 with vs 2005 64 bit with a bit of hacking, however it h

Re: [Numpy-discussion] Installation info

2008-06-02 Thread Hanni Ali
Hi David, > I can't build official binaries with VS: I don't have VS. Also, there is > the problem of building the fortran dependencies (BLAS/LAPACK). I don't > know if it is even possible to build ATLAS on windows x64. Even assuming > we only use netlib BLAS/LAPACK, I still need a fortran comp

Re: [Numpy-discussion] Installation info

2008-06-02 Thread Hanni Ali
Excellenm, thanks for clearing all that up. How about numpy with 2.6, any issues? Hanni 2008/6/2 David Cournapeau <[EMAIL PROTECTED]>: > Hanni Ali wrote: > > > > Yes I had used the internal versions in the mean time, but I do want > > to try to use the intel fortran

Re: [Numpy-discussion] Installation info

2008-06-03 Thread Hanni Ali
is piece of code numpy compiles and appears to function. Hanni 2008/6/2 Hanni Ali <[EMAIL PROTECTED]>: > Excellenm, thanks for clearing all that up. > > How about numpy with 2.6, any issues? > > Hanni > > 2008/6/2 David Cournapeau <[EMAIL PROTECTED]>: > &g

Re: [Numpy-discussion] Installation info

2008-06-09 Thread Hanni Ali
I have used the trail of Visual Studio 2008 (on full Server 2003) it copmiles and runs well if you comment out the lines meantioned earlier on in this thread. I am planning to spend some time with the intel fortran compiler to try to compile blas/lapack in the next few weeks. It is part of my curr

Re: [Numpy-discussion] Installation info

2008-06-09 Thread Hanni Ali
not produce the error (at least that's what I would have thought) i.e. if it isn't recognised the compiler should simply be using the alternate definition of the frexpf function defined, although I suspect it is a little less efficient than the float one from the libs. Hanni 2008/6/3 Ro

Re: [Numpy-discussion] "import numpy" is slow

2008-07-01 Thread Hanni Ali
Would it not be possible to import just the necessary module of numpy to meet the necessary functionality of your application. i.e. import numpy.core or whatever you're using you could even do: import numpy.core as numpy I think, to simplify your code, I'm no expert though. Hanni 2008/7/1

Re: [Numpy-discussion] "import numpy" is slow

2008-07-01 Thread Hanni Ali
ts by importing > numpy, so it will be even slower. > > Matthieu > > 2008/7/1 Hanni Ali <[EMAIL PROTECTED]>: > > Would it not be possible to import just the necessary module of numpy to > > meet the necessary functionality of your application. > > > > i.e

Re: [Numpy-discussion] "import numpy" is slow

2008-07-31 Thread Hanni Ali
Hi All, I've been reading this discussion with interest. I would just to highlight an alternate use of numpy to interactive use. We have a cluster of machines which process tasks on an individual basis where a master tasks may spawn 600 slave tasks to be processed. These tasks are spread across t