[Numpy-discussion] numpy.savetxt for complex arrays

2011-11-27 Thread Paul Anton Letnes
Hello numpy fans, a patch and pull request for ticket 1573 has been posted, giving numpy.savetxt the possibility to save complex arrays to text files. Formatting of the output is supported roughly along the same lines as for real numbers. https://github.com/numpy/numpy/pull/172 Share, test,

Re: [Numpy-discussion] dtype

2011-11-28 Thread Paul Anton Letnes
Hi, I don't know about documentation, but I always use syntax like zeros(10, dtype=numpy.float64) where you have dtypes like numpy.int8 numpy.uint32 numpy.complex128 # == two numpy.float64, one for real, one for imag. etc. This is usually less confusing to my mind. One caveat: floats above 64

Re: [Numpy-discussion] Reading automatically all the parameters from a file

2011-11-30 Thread Paul Anton Letnes
On 30. nov. 2011, at 12:09, Giovanni Plantageneto wrote: Dear all, I have a simple question. I would like to have all the parameters of a model written in a configuration file (text), and I would like to have all the parameters in the file automatically defined inside a program. I find

Re: [Numpy-discussion] What does fftn take as parameters?

2011-12-06 Thread Paul Anton Letnes
On 6. des. 2011, at 17:32, Roger Binns wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/12/11 01:58, Pauli Virtanen wrote: I think this cannot be helped --- it does not make sense to explain basic Numpy concepts in every docstring, especially `axis` and `shape` are very

Re: [Numpy-discussion] np.zeros(2, 'S') returns empty strings.

2012-01-14 Thread Paul Anton Letnes
On 15. jan. 2012, at 01:21, josef.p...@gmail.com wrote: On Sat, Jan 14, 2012 at 5:25 PM, Benjamin Root ben.r...@ou.edu wrote: On Sat, Jan 14, 2012 at 4:16 PM, Benjamin Root ben.r...@ou.edu wrote: On Sat, Jan 14, 2012 at 4:12 PM, Charles R Harris charlesr.har...@gmail.com wrote: This

Re: [Numpy-discussion] array metadata

2012-01-26 Thread Paul Anton Letnes
If by store you mean store on disk, I recommend h5py datasets and attributes. Reportedly pytables is also good but I don't have any first hand experience there. Both python modules use the hdf5 library, written in C/C++/Fortran. Paul On Wed, Jan 25, 2012 at 7:47 PM, Val Kalatsky

Re: [Numpy-discussion] how to cite 1Xn array as nX1 array?

2012-01-27 Thread Paul Anton Letnes
On 27. jan. 2012, at 14:52, Chao YUE wrote: Dear all, suppose I have a ndarray a: In [66]: a Out[66]: array([0, 1, 2, 3, 4]) how can use it as 5X1 array without doing a=a.reshape(5,1)? Several ways, this is one, although not much simpler. In [6]: a Out[6]: array([0, 1, 2, 3, 4]) In

Re: [Numpy-discussion] Numpy governance update

2012-02-16 Thread Paul Anton Letnes
An example I really like is LibreOffice's get involved page. http://www.libreoffice.org/get-involved/ Producing something similar for NumPy will take some work, but I believe it's needed. Speaking as someone who has contributed to numpy in a microscopic fashion, I agree completely. I

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-19 Thread Paul Anton Letnes
In the language wars, I have one question. Why is Fortran not being considered? Fortran already implements many of the features that we want in NumPy: - slicing and similar operations, at least some of the fancy indexing kind - element-wise array operations and function calls - array

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-20 Thread Paul Anton Letnes
On 20. feb. 2012, at 16:29, Sturla Molden wrote: Den 20.02.2012 08:35, skrev Paul Anton Letnes: In the language wars, I have one question. Why is Fortran not being considered? Fortran already implements many of the features that we want in NumPy: Yes ... but it does not make Fortran

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-02-23 Thread Paul Anton Letnes
As others on this list, I've also been confused a bit by the prolific numpy interfaces to reading text. Would it be an idea to create some sort of object oriented solution for this purpose? reader = np.FileReader('my_file.txt') reader.loadtxt() # for backwards compat.; np.loadtxt could

Re: [Numpy-discussion] f2py with int8

2012-04-16 Thread Paul Anton Letnes
Hi, this probably does not help with your problem. However, I would recommend changing your fortran code to: subroutine print_bit_array(bits) use iso_fortran_env integer(kind=int8),intent(in),dimension(:)::bits print*,'bits = ',bits end subroutine print_bit_array In that way you could

Re: [Numpy-discussion] f2py with int8

2012-04-17 Thread Paul Anton Letnes
Ah, come to think of it, I think that f2py only supports literal kind values. Maybe that's your problem. Paul On 17. apr. 2012, at 07:58, Sameer Grover wrote: On Tuesday 17 April 2012 11:02 AM, John Mitchell wrote: Hi, I am using f2py to pass a numpy array of type numpy.int8 to fortran.

Re: [Numpy-discussion] f2py with int8

2012-04-18 Thread Paul Anton Letnes
you to mean that 'int8' is not a literal kind value while 1 and 8 are examples of literal kind values. Thanks, John On Tue, Apr 17, 2012 at 10:12 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: Ah, come to think of it, I think that f2py only supports literal kind values

Re: [Numpy-discussion] Removing masked arrays for 1.7? (Was 1.7 blockers)

2012-04-22 Thread Paul Anton Letnes
On 21. apr. 2012, at 00:16, Drew Frank wrote: On Fri, Apr 20, 2012 at 11:45 AM, Chris Barker chris.bar...@noaa.gov wrote: On Fri, Apr 20, 2012 at 11:39 AM, Dag Sverre Seljebotn d.s.seljeb...@astro.uio.no wrote: Oh, right. I was thinking small as in fits in L2 cache, not small as in a few

Re: [Numpy-discussion] timing results (was: record arrays initialization)

2012-05-03 Thread Paul Anton Letnes
On 3. mai 2012, at 19:33, Moroney, Catherine M (388D) wrote: A quick recap of the problem: a 128x512 array of 7-element vectors (element), and a 5000-vector training dataset (targets). For each vector in element, I want to find the best-match in targets, defined as minimizing the

Re: [Numpy-discussion] timing results (was: record arrays initialization)

2012-05-04 Thread Paul Anton Letnes
On Fri, May 4, 2012 at 12:49 AM, Keith Goodman kwgood...@gmail.com wrote: On Thu, May 3, 2012 at 3:12 PM, Moroney, Catherine M (388D) catherine.m.moro...@jpl.nasa.gov wrote: Here is the python code: def single(element, targets):    if (isinstance(element, tuple)):        xelement =

Re: [Numpy-discussion] ANN: NumPy 1.6.2 release candidate 1

2012-05-05 Thread Paul Anton Letnes
Hi, I'm getting a couple of errors when testing. System: Arch Linux (updated today) Python 3.2.3 gcc 4.7.0 (Anything else?) I think that this error: AssertionError: selectedrealkind(19): expected -1 but got 16 is due to the fact that newer versions of gfortran actually supports precision this

Re: [Numpy-discussion] ANN: NumPy 1.6.2 release candidate 1

2012-05-06 Thread Paul Anton Letnes
All tests for 1.6.2rc1 pass on Mac OS X 10.7.3 python 2.7.2 gcc 4.2 (Apple) Great! Paul On 6. mai 2012, at 00:12, Charles R Harris wrote: On Sat, May 5, 2012 at 2:56 PM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: Hi, I'm getting a couple of errors when testing. System

Re: [Numpy-discussion] ANN: NumPy 1.6.2 release candidate 1

2012-05-13 Thread Paul Anton Letnes
On Sat, May 12, 2012 at 9:50 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Sun, May 6, 2012 at 12:12 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Sat, May 5, 2012 at 2:56 PM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: Hi, I'm getting a couple of errors

Re: [Numpy-discussion] ANN: NumPy 1.6.2 release candidate 1

2012-05-14 Thread Paul Anton Letnes
On Mon, May 14, 2012 at 9:47 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Sun, May 13, 2012 at 1:14 PM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: On Sat, May 12, 2012 at 9:50 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Sun, May 6, 2012 at 12:12 AM

Re: [Numpy-discussion] better error message possible?

2012-06-04 Thread Paul Anton Letnes
On 4. juni 2012, at 16:27, Thouis (Ray) Jones wrote: On Fri, Jun 1, 2012 at 6:56 PM, Chris Withers ch...@simplistix.co.uk wrote: On 01/06/2012 16:39, Benjamin Root wrote: import numpy numpy.zeros(10)[-123] Traceback (most recent call last): File stdin, line

Re: [Numpy-discussion] better error message possible?

2012-06-07 Thread Paul Anton Letnes
On 7. juni 2012, at 10:30, Thouis (Ray) Jones wrote: I've opened a PR at https://github.com/numpy/numpy/pull/296 for discussion. A typical result np.zeros((3,3))[[1,2,3]] Traceback (most recent call last): File stdin, line 1, in module IndexError: index 3 is out of bounds for axis 0:

Re: [Numpy-discussion] numpy and readline installation fails

2012-07-04 Thread Paul Anton Letnes
Hello, I don't know exactly what went wrong. I'd start out my debugging by 1) which python # see whether you're running apple's python in /usr/bin/python, or the one you tried to install 2) which easy_install # did you run Apple-python's easy_install, or the one you (tried to) installed? 3) If

Re: [Numpy-discussion] Numpy Installation Problem on Redhat Linux

2012-07-05 Thread Paul Anton Letnes
Hi, are you sure that you want g77 and not gfortran? If you want gfortran, you should pass the --fcompiler=gnu95 flag to setup.py. Which redhat version are you building on? (I don't know red hat well enough to comment, but perhaps someone else do...) Paul On 6. juli 2012, at 03:00,

Re: [Numpy-discussion] Numpy Installation Problem on Redhat Linux

2012-07-06 Thread Paul Anton Letnes
However, I got the following error message: error: Command /usr/bin/g77 -g -Wall -g -Wall -shared build/temp.linux-x86_64-2.6/build/src.linux-x86_64-2.6/scipy/integrate/vodemodule.o build/temp.linux-x86_64-2.6/build/src.linux-x86_64-2.6/fortranobject.o -L/home/username/lib/ -L/usr/lib64

Re: [Numpy-discussion] Second try: possible bug in assignment to complex array

2012-08-10 Thread Paul Anton Letnes
On 10. aug. 2012, at 09:54, Mark Bakker wrote: I am giving this a second try. Can anybody help me out? I think there is a problem with assigning a 1D complex array of length one to a position in another complex array. Example: a = ones(1,'D') b = ones(1,'D') a[0] = b

Re: [Numpy-discussion] memory-efficient loadtxt

2012-09-30 Thread Paul Anton Letnes
For convenience and clarity, this is the diff in question: https://github.com/Dynetrekk/numpy-1/commit/5bde67531a2005ef80a2690a75c65cebf97c9e00 And this is my numpy fork: https://github.com/Dynetrekk/numpy-1/ Paul On Sun, Sep 30, 2012 at 4:14 PM, Paul Anton Letnes paul.anton.let...@gmail.com

Re: [Numpy-discussion] memory-efficient loadtxt

2012-10-03 Thread Paul Anton Letnes
On 3. okt. 2012, at 17:48, Wes McKinney wrote: On Monday, October 1, 2012, Chris Barker wrote: Paul, Nice to see someone working on these issues, but: I'm not sure the problem you are trying to solve -- accumulating in a list is pretty efficient anyway -- not a whole lot overhead.

Re: [Numpy-discussion] memory-efficient loadtxt

2012-10-03 Thread Paul Anton Letnes
On 1. okt. 2012, at 21:07, Chris Barker wrote: Paul, Nice to see someone working on these issues, but: I'm not sure the problem you are trying to solve -- accumulating in a list is pretty efficient anyway -- not a whole lot overhead. Oh, there's significant overhead, since we're not

Re: [Numpy-discussion] memory-efficient loadtxt

2012-10-03 Thread Paul Anton Letnes
On 3. okt. 2012, at 18:22, Chris Barker wrote: On Wed, Oct 3, 2012 at 9:05 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: I'm not sure the problem you are trying to solve -- accumulating in a list is pretty efficient anyway -- not a whole lot overhead. Oh, there's significant

Re: [Numpy-discussion] ANN: WinPython v2.7.3.0

2012-10-13 Thread Paul Anton Letnes
Hi Pierre, first I'd like to congratulate you on a product which seems to finally solve all the problems I have at work regarding python scripting. A portable, fully featured python distribution is indeed very useful. One question though: Is there a way to run winpython's IPython under cygwin,

Re: [Numpy-discussion] numpy.savez(_compressed) in loop

2012-10-30 Thread Paul Anton Letnes
On 29. okt. 2012, at 11:29, Radek Machulka wrote: Hi, is there a way how to save more arrays into single npy (npz if possible) file in loop? Something like: fw = open('foo.bar', 'wb') while foo: arr = np.array(bar) np.savez_compressed(fw, arr) fw.close() Or some

Re: [Numpy-discussion] Embedded NumPy LAPACK errors

2013-01-05 Thread Paul Anton Letnes
On 4. jan. 2013, at 21:42, m...@eml.cc wrote: Hiall, I am trying to embed numerical code in a mexFunction, as called by MATLAB, written as a Cython function. NumPy core functions and BLAS work fine, but calls to LAPACK function such as SVD seem to be made against to MATLAB's linked

Re: [Numpy-discussion] Casting Bug or a Feature?

2013-01-16 Thread Paul Anton Letnes
On 17.01.2013 04:43, Patrick Marsh wrote: Thanks, everyone for chiming in. Now that I know this behavior exists, I can explicitly prevent it in my code. However, it would be nice if a warning or something was generated to alert users about the inconsistency between var += ... and var = var

Re: [Numpy-discussion] N dimensional dichotomy optimization

2010-11-28 Thread Paul Anton Letnes
On Tue, Nov 23, 2010 at 3:37 AM, Sebastian Walter sebastian.wal...@gmail.com wrote: On Tue, Nov 23, 2010 at 11:17 AM, Gael Varoquaux gael.varoqu...@normalesup.org wrote: On Tue, Nov 23, 2010 at 11:13:23AM +0100, Sebastian Walter wrote: I'm not familiar with dichotomy optimization.

Re: [Numpy-discussion] [PATCH] gfortran under macports

2010-12-04 Thread Paul Anton Letnes
On 3. des. 2010, at 16.24, Fabian Pedregosa wrote: Hi all. Macports installs gfortran as part of the gcc package, but names it gfortran-mp-$version, without providing a symbolic link to a default gcfortran executable, and thus numpy.distutils is unable to find the right executable. The

Re: [Numpy-discussion] [PATCH] gfortran under macports

2010-12-04 Thread Paul Anton Letnes
Mabe I am wrong somehow, but in my experience the easiest install of scipy is 'port install py26-scipy'. For new users, I do not see why one would recommend to build manually from source? Macports can do it for you, automagically... Paul 4. des.. 2010 15.04 Ralf Gommers

Re: [Numpy-discussion] Variable in an array name?

2011-01-12 Thread Paul Anton Letnes
On 12. jan. 2011, at 16.40, dstaley wrote: Zachary Pincus-2 wrote: Is it possible to use a variable in an array name? I am looping through a bunch of calculations, and need to have each array as a separate entity. I'm pretty new to python and numpy, so forgive my ignorance. I'm

[Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Paul Anton Letnes
Hi! This little snippet of code tricked me (in a more convoluted form). The *= operator does not change the datatype of the left hand side array. Is this intentional? It did fool me and throw my results quite a bit off. I always assumed that 'a *= b' means exactly the same as 'a = a * b' but

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Paul Anton Letnes
Heisann! On 16. mars 2011, at 14.30, Dag Sverre Seljebotn wrote: On 03/16/2011 02:24 PM, Paul Anton Letnes wrote: Hi! This little snippet of code tricked me (in a more convoluted form). The *= operator does not change the datatype of the left hand side array. Is this intentional? It did

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Paul Anton Letnes
On 16. mars 2011, at 15.49, Chris Barker wrote: On 3/16/11 6:34 AM, Charles R Harris wrote: On Wed, Mar 16, 2011 at 7:24 AM, Paul Anton Letnes Yes, it is intentional. Numpy is more C than Python in this case, I don't know that C has anything to do with it -- the *= operators were added

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Paul Anton Letnes
On 16. mars 2011, at 15.57, Dag Sverre Seljebotn wrote: On 03/16/2011 02:35 PM, Paul Anton Letnes wrote: Heisann! Hei der, On 16. mars 2011, at 14.30, Dag Sverre Seljebotn wrote: On 03/16/2011 02:24 PM, Paul Anton Letnes wrote: Hi! This little snippet of code tricked me (in a more

Re: [Numpy-discussion] *= operator not intuitive

2011-03-16 Thread Paul Anton Letnes
This comes up for discussion on a fairly regular basis. I tend towards the more warnings side myself, but you aren't going to get the current behavior changed unless you can convince a large bunch of people that it is the right thing to do, which won't be easy. For one thing, a lot of

Re: [Numpy-discussion] What Requires C and what is just python

2011-03-21 Thread Paul Anton Letnes
On 20. mars 2011, at 16.08, Ben Smith wrote: So, in addition to my computer science work, I'm a PhD student in econ. Right now, the class is using GAUSS for almost everything. This sort of pisses me off because it means people are building libraries of code that become valueless when

Re: [Numpy-discussion] Problems building NumPy with GotoBLAS

2011-03-22 Thread Paul Anton Letnes
I'm no expert, but I just pulled off the scipy+numpy+GotoBLAS2 installation. From what I gather, the Makefile for libgoto2 downloads and compiles the generic lapack from netlib. It also wraps lapack into libgoto2.so/.a. I believe the idea is as long as the BLAS implementation is fast(TM), the

Re: [Numpy-discussion] how to loop read input over various file with same extension in a folder (newbie question)

2011-03-24 Thread Paul Anton Letnes
One way is to use python dicts. Pseudocode: arrays = {} integer = 0 for file in allfiles: integer +=1 data = file.read() arrays['a' + '%d' % integer] = data I would consider using the filename as the key instead of a1, a2, etc. That way you have that information readily

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Paul Anton Letnes
Hi! I have had a look at the list of numpy.loadtxt tickets. I have never contributed to numpy before, so I may be doing stupid things - don't be afraid to let me know! My opinions are my own, and in detail, they are: 1752: I attach a possible patch. FWIW, I agree with the request. The

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Paul Anton Letnes
Hi Derek! On 26. mars 2011, at 15.48, Derek Homeier wrote: Hi again, On 26 Mar 2011, at 15:20, Derek Homeier wrote: 1562: I attach a possible patch. This could also be the default behavior to my mind, since the function caller can simply call numpy.squeeze if needed. Changing default

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-27 Thread Paul Anton Letnes
On 26. mars 2011, at 21.44, Derek Homeier wrote: Hi Paul, having had a look at the other tickets you dug up, My opinions are my own, and in detail, they are: 1752: I attach a possible patch. FWIW, I agree with the request. The patch is written to be compatible with the fix in

[Numpy-discussion] Import patch

2011-04-04 Thread Paul Anton Letnes
Hi. When looking at the loadtxt/savetxt tickets, I noticed that the 're' module is imported in an odd place. I therefore suggest that this import is moved to the top of the file, in order to gather these as much as possible. I find the code easier to read then. After all, there is no 'try /

Re: [Numpy-discussion] Import patch

2011-04-04 Thread Paul Anton Letnes
On 4. apr. 2011, at 15.34, Charles R Harris wrote: On Sun, Apr 3, 2011 at 4:35 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: Hi. When looking at the loadtxt/savetxt tickets, I noticed that the 're' module is imported in an odd place. I therefore suggest that this import

Re: [Numpy-discussion] Import patch

2011-04-04 Thread Paul Anton Letnes
On 4. apr. 2011, at 16.42, Charles R Harris wrote: On Mon, Apr 4, 2011 at 8:29 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: On 4. apr. 2011, at 15.34, Charles R Harris wrote: On Sun, Apr 3, 2011 at 4:35 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote

Re: [Numpy-discussion] Strange behavior of operator *=

2011-04-05 Thread Paul Anton Letnes
On 5. apr. 2011, at 15.39, Alan G Isaac wrote: On 4/5/2011 9:26 AM, François Steinmetz wrote: It does not change the dtype, 'int' is just interpreted as 'int64' : So the meaning of 'int' is system specific? import numpy as np; a=np.eye(2,dtype='int'); a.dtype dtype('int32')

Re: [Numpy-discussion] Zero row in SVD's unitary matrix on some Mac's

2011-04-25 Thread Paul Anton Letnes
On 25. apr. 2011, at 19.57, Pauli Virtanen wrote: On Mon, 25 Apr 2011 10:16:13 -0700, Rob Beezer wrote: [clip] Many more details and complete transcripts are at: http://trac.sagemath.org/sage_trac/ticket/11248 Any thoughts or advice to help us understand this would be greatly appreciated.

Re: [Numpy-discussion] ANN: Numpy 1.6.0 release candidate 2

2011-05-03 Thread Paul Anton Letnes
On Mac OS X 10.6.7 with macports python 2.7 I get as follows: OK (KNOWNFAIL=3, SKIP=1) Python version: Python 2.7.1 (r271:86832, Jan 12 2011, 10:44:27) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin % gfortran --version GNU Fortran (GCC) 4.5.3 Well done to everyone working on numpy 1.6! Paul.

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-04 Thread Paul Anton Letnes
On 4. mai 2011, at 17.34, Derek Homeier wrote: Hi Paul, I've got back to your suggestion re. the ndmin flag for loadtxt from a few weeks ago... On 27.03.2011, at 12:09PM, Paul Anton Letnes wrote: 1562: I attach a possible patch. This could also be the default behavior to my mind

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-04 Thread Paul Anton Letnes
On 4. mai 2011, at 20.33, Benjamin Root wrote: On Wed, May 4, 2011 at 7:54 PM, Derek Homeier de...@astro.physik.uni-goettingen.de wrote: On 05.05.2011, at 2:40AM, Paul Anton Letnes wrote: But: Isn't the numpy.atleast_2d and numpy.atleast_1d functions written for this? Shouldn't we

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-05 Thread Paul Anton Letnes
On 5. mai 2011, at 08.49, Benjamin Root wrote: On Wed, May 4, 2011 at 11:08 PM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: On 4. mai 2011, at 20.33, Benjamin Root wrote: On Wed, May 4, 2011 at 7:54 PM, Derek Homeier de...@astro.physik.uni-goettingen.de wrote

[Numpy-discussion] bug in numpy.ndarray?

2011-05-08 Thread Paul Anton Letnes
Hi, it seems that I have found a bug in numpy.ndarray. numpy 1.5.1, python 2.7.1 from macports on mac os x 10.6.7. I got the same error on Fedora 14 with numpy 1.4.1 and python 2.7. Appending a [0] to the last line solves the problem. % python testcrash.py

Re: [Numpy-discussion] bug in numpy.ndarray?

2011-05-08 Thread Paul Anton Letnes
On 8. mai 2011, at 17.32, Warren Weckesser wrote: On Sun, May 8, 2011 at 7:23 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sun, May 8, 2011 at 3:15 PM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: Hi, it seems that I have found a bug in numpy.ndarray. numpy

[Numpy-discussion] silly user wish

2011-06-09 Thread Paul Anton Letnes
Dear numpy developers, users, and fans: I wish for a numpy that will magically detect all my errors. Barring the invention of a numpy version which knows what I need, not what I ask of it, I have the following, simpler wish: if one takes myarray.real or myarray.imag of a float (or possibly

Re: [Numpy-discussion] f2py and openmp on mac os x with gfortran

2011-07-21 Thread Paul Anton Letnes
Hi, I had the same problem. I think this might work: FFLAGS='-fopenmp' f2py -c (etc) The thing is that f2py doesn't let you pass the -fopenmp flag at the right time to the compiler, so you have to use some sort of environment variable trick. By the way, as far as I know, this is the case also

[Numpy-discussion] ticket 1793

2011-07-28 Thread Paul Anton Letnes
Hi! In my quest for a bug-free numpy I have, I think, fixed ticket 1793. https://github.com/numpy/numpy/pull/123 Enjoy - feedback welcome, of course. Cheers, Paul. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

[Numpy-discussion] numpy.savetxt Ticket 1573 - suggested fix

2011-08-07 Thread Paul Anton Letnes
(A pull request has been submitted on github, but I'm posting here so people can discuss the user interface issues.) As of now, the fmt= kwarg kan be (for complex dtype): a) a single specifier, fmt='%.4e', resulting in numbers formatted like ' (%s+%sj)' % (fmt, fmt) b) a full string specifying

Re: [Numpy-discussion] [ANN] Cython 0.15

2011-08-07 Thread Paul Anton Letnes
Looks like you have done some great work! I've been using f2py in the past, but I always liked the idea of cython - gradually wrapping more and more code as the need arises. I read somewhere that fortran wrapping with cython was coming - dare I ask what the status on this is? Is it a goal for

Re: [Numpy-discussion] Efficient way to load a 1Gb file?

2011-08-10 Thread Paul Anton Letnes
On 10. aug. 2011, at 21.03, Gael Varoquaux wrote: On Wed, Aug 10, 2011 at 04:01:37PM -0400, Anne Archibald wrote: A 1 Gb text file is a miserable object anyway, so it might be desirable to convert to (say) HDF5 and then throw away the text file. +1 G +1 and a very warm recommendation

Re: [Numpy-discussion] bug with latest numpy git snapshot build with Python3

2011-08-13 Thread Paul Anton Letnes
On 13. aug. 2011, at 20.42, Charles R Harris wrote: 2011/8/11 Dmitrey tm...@ukr.net bug in KUBUNTU 11.04, latest numpy git snapshot build with Python3 import numpy Traceback (most recent call last): File stdin, line 1, in module File

Re: [Numpy-discussion] Reconstruct multidimensional array from buffer without shape

2011-08-19 Thread Paul Anton Letnes
On 19. aug. 2011, at 19.57, Ian wrote: Right. I'm new to NumPy so I figured I'd check if there was some nifty way of preserving the shape without storing it in the database that I hadn't discovered yet. No worries, I'll store the shape alongside the array. Thanks for the reply. I love

Re: [Numpy-discussion] saving groups of numpy arrays to disk

2011-08-21 Thread Paul Anton Letnes
Hi! On 21. aug. 2011, at 00.18, Chris Withers wrote: Hi All, I've got a tree of nested dicts that at their leaves end in numpy arrays of identical sizes. What's the easiest way to persist these to disk so that I can pick up with them where I left off? Probably giving them names like

Re: [Numpy-discussion] saving groups of numpy arrays to disk

2011-08-26 Thread Paul Anton Letnes
On 25. aug. 2011, at 23.49, David Warde-Farley wrote: On 2011-08-25, at 2:42 PM, Chris.Barker wrote: On 8/24/11 9:22 AM, Anthony Scopatz wrote: You can use Python pickling, if you do *not* have a requirement for: I can't recall why, but it seem pickling of numpy arrays has been

Re: [Numpy-discussion] Eigenvalues did not converge

2011-08-29 Thread Paul Anton Letnes
I recently got into trouble with these calculations (although I used scipy). I actually got segfaults and bus errors. The solution for me was to not link against ATLAS, but rather link against Apple's blas/lapack libraries. That got everything working again. I would suggest trying to install

Re: [Numpy-discussion] Eigenvalues did not converge

2011-09-04 Thread Paul Anton Letnes
? On Mon, Aug 29, 2011 at 9:31 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: I recently got into trouble with these calculations (although I used scipy). I actually got segfaults and bus errors. The solution for me was to not link against ATLAS, but rather link against Apple's blas

Re: [Numpy-discussion] build errors

2011-10-06 Thread Paul Anton Letnes
You can use the BLAS and LAPACK environment variables. export BLAS=/path/to/libatlas.so export LAPACK=/path/to/libatlas.so python setup.py build I've recently had problems with ATLAS solving equation systems incorrectly for certain inputs with no adequate explanation. Re-running the same