Re: [Numpy-discussion] numpy.array() of mixed integers and strings can truncate data

2011-12-01 Thread Derek Homeier
On 1 Dec 2011, at 17:39, Charles R Harris wrote: On Thu, Dec 1, 2011 at 6:52 AM, Thouis (Ray) Jones tho...@gmail.com wrote: Is this expected behavior? np.array([-345,4,2,'ABC']) array(['-34', '4', '2', 'ABC'], dtype='|S3') Given that strings should be the result, this looks like a

Re: [Numpy-discussion] numpy.array() of mixed integers and strings can truncate data

2011-12-01 Thread Derek Homeier
On 1 Dec 2011, at 21:35, Chris Barker wrote: On 12/1/2011 9:15 AM, Derek Homeier wrote: np.array((2, 12,0.001+2j), dtype='|S8') array(['2', '12', '(0.001+2'], dtype='|S8') - notice the last value is only truncated because it had first been converted into a standard complex

Re: [Numpy-discussion] upsample or scale an array

2011-12-03 Thread Derek Homeier
On 03.12.2011, at 6:22PM, Robin Kraft wrote: That does repeat the elements, but doesn't get them into the desired order. In [4]: print a [[1 2] [3 4]] In [7]: np.tile(a, 4) Out[7]: array([[1, 2, 1, 2, 1, 2, 1, 2], [3, 4, 3, 4, 3, 4, 3, 4]]) In [8]: np.tile(a,

Re: [Numpy-discussion] upsample or scale an array

2011-12-03 Thread Derek Homeier
On 03.12.2011, at 6:47PM, Olivier Delalleau wrote: Ah sorry, I hadn't read carefully enough what you were trying to achieve. I think the double repeat solution looks like your best option then. Considering that it is a lot shorter than fixing the tile() result, you are probably right (I've

Re: [Numpy-discussion] numpy 1.7.0 release?

2011-12-06 Thread Derek Homeier
On 06.12.2011, at 11:13PM, Wes McKinney wrote: This isn't the place for this discussion but we should start talking about building a *high performance* flat file loading solution with good column type inference and sensible defaults, etc. It's clear that loadtable is aiming for highest

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Derek Homeier
On 07.12.2011, at 5:07AM, Olivier Delalleau wrote: I *think* it may work better if you replace the last 3 lines in your loop by: a=all_TSFC[0] if len(all_TSFC) 1: N.maximum(a, TSFC, out=a) Not 100% sure that would work though, as I'm not entirely

Re: [Numpy-discussion] loop through values in a array and find maximum as looping

2011-12-06 Thread Derek Homeier
On 07.12.2011, at 5:54AM, questions anon wrote: sorry the 'all_TSFC' is for my other check of maximum using concatenate and N.max, I know that works so I am comparing it to this method. The only reason I need another method is for memory error issues. I like the code I have written so far

Re: [Numpy-discussion] numpy1.6.1 install fortran compiler error

2011-12-20 Thread Derek Homeier
Hi Jack, In order to install scipy, I am trying to install numpy 1.6.1. on GNU/linux redhat 2.6.18. But, I got error about fortran compiler. I have gfortran. I do not have f77/f90/g77/g90. that's good! I run : python setup.py build --fcompiler=gfortran It woks well and tells

Re: [Numpy-discussion] numpy1.6.1 install fortran compiler error

2011-12-20 Thread Derek Homeier
On 20.12.2011, at 9:01PM, Jack Bryan wrote: customize Gnu95FCompiler using config C compiler: gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath

Re: [Numpy-discussion] structured array with submember assign

2011-12-26 Thread Derek Homeier
On 26.12.2011, at 7:37PM, Fabian Dill wrote: I have a problem with a structured numpy array. I create is like this: tiles = numpy.zeros((header[width], header[height],3), dtype = numpy.uint8) and later on, assignments such as this: tiles[x, y,0] = 3 Now uint8 is not sufficient anymore,

Re: [Numpy-discussion] find location of maximum values

2012-01-04 Thread Derek Homeier
On 04.01.2012, at 5:10AM, questions anon wrote: Thanks for your responses but I am still having difficuties with this problem. Using argmax gives me one very large value and I am not sure what it is. There shouldn't be any issues with the shape. The latitude and longitude are the same

Re: [Numpy-discussion] Saving and loading a structured array from a TEXT file

2012-01-23 Thread Derek Homeier
On 23 Jan 2012, at 21:15, Emmanuel Mayssat wrote: Is there a way to save a structured array in a text file? My problem is not so much in the saving procedure, but rather in the 'reloading' procedure. See below In [3]: import numpy as np In [4]: r = np.ones(3,dtype=[('name', '|S5'),

Re: [Numpy-discussion] Saving and loading a structured array from a TEXT file

2012-01-23 Thread Derek Homeier
On 23 Jan 2012, at 22:07, Derek Homeier wrote: In [4]: r = np.ones(3,dtype=[('name', '|S5'), ('foo', 'i8'), ('bar', 'f8')]) In [5]: r.tofile('toto.txt',sep='\n') bash-4.2$ cat toto.txt ('1', 1, 1.0) ('1', 1, 1.0) ('1', 1, 1.0) cnv = {0: lambda s: s.lstrip('('), -1: lambda s

Re: [Numpy-discussion] 'Advanced' save and restore operation

2012-01-23 Thread Derek Homeier
On 24 Jan 2012, at 01:45, Olivier Delalleau wrote: Note sure if there's a better way, but you can do it with some custom load and save functions: with open('f.txt', 'w') as f: ... f.write(str(x.dtype) + '\n') ... numpy.savetxt(f, x) with open('f.txt') as f: ... dtype =

Re: [Numpy-discussion] remove redundant dimension in a ndarray?

2012-03-16 Thread Derek Homeier
Dear Chao, Do we have a function in numpy that can automatically shrink a ndarray with redundant dimension? like I have a ndarray with shape of (13,1,1,160,1), now I have written a small function to change the array to dimension of (13,160) [reduce the extra dimension with length as 1].

Re: [Numpy-discussion] Trying to read 500M txt file using numpy.genfromtxt within ipython shell

2012-03-20 Thread Derek Homeier
On 20 Mar 2012, at 14:40, Chao YUE wrote: I would be in agree. thanks! I use gawk to separate the file into many files by year, then it would be easier to handle. anyway, it's not a good practice to produce such huge line txt files Indeed it's not, but it's also not good practice to

Re: [Numpy-discussion] How to Extract the Number of Rows and Columns in a Matrix

2012-03-26 Thread Derek Homeier
On 27.03.2012, at 1:26AM, Olivier Delalleau wrote: len(M) will give you the number of rows of M. For columns I just use M.shape[1] myself, I don't know if there exists a shortcut. You can use tuple unpacking, if that helps keeping your code conciser… nrow, ncol = M.shape Cheers,

Re: [Numpy-discussion] AttributeError with shape command

2012-03-26 Thread Derek Homeier
On 27.03.2012, at 2:07AM, Stephanie Cooke wrote: I am new to numpy. When I try to use the command array.shape, I get the following error: AttributeError: 'list' object has no attribute 'shape' Is anyone familiar with this type of error? It means 'array' actually is not one, more

Re: [Numpy-discussion] how to check type of array?

2012-03-29 Thread Derek Homeier
On 29 Mar 2012, at 13:54, Chao YUE wrote: how can I check type of array in if condition expression? In [75]: type(a) Out[75]: type 'numpy.ndarray' In [76]: a.dtype Out[76]: dtype('int32') a.dtype=='int32'? this and a.dtype=='i4' a.dtype==np.int32 all work. For a more general check

Re: [Numpy-discussion] how to check type of array?

2012-03-29 Thread Derek Homeier
On 29 Mar 2012, at 14:49, Robert Kern wrote: all work. For a more general check (e.g. if it is any type of integer), you can do np.issubclass_(a.dtype.type, np.integer) I don't recommend using that. Use np.issubdtype(a.dtype, np.integer) instead. Sorry, you're right, this works the same

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

2012-05-08 Thread Derek Homeier
On 06.05.2012, at 8:16AM, Paul Anton Letnes wrote: All tests for 1.6.2rc1 pass on Mac OS X 10.7.3 python 2.7.2 gcc 4.2 (Apple) Passing as well on 10.6 x86_64 and on 10.5.8 ppc with python 2.5.6/2.6.6/2.7.2 Apple gcc 4.0.1, but I am getting one failure on Lion (same with Python

Re: [Numpy-discussion] silly isscalar question

2012-05-29 Thread Derek Homeier
On 29 May 2012, at 15:00, Mark Bakker wrote: Why does isscalar('hello') return True? I thought it would check for a number? No, it checks for something that is of 'scalar type', which probably can be translated as 'not equivalent to an array'. Since strings can form numpy arrays, I guess

Re: [Numpy-discussion] silly isscalar question

2012-05-29 Thread Derek Homeier
On 29 May 2012, at 15:42, Nathaniel Smith wrote: I note the fine distinction between np.isscalar( ('hello') ) and np.isscalar( ('hello'), )... NB you mean np.isscalar( ('hello',) ), which creates a single-element tuple. A trailing comma attached to a value in Python normally creates a

Re: [Numpy-discussion] Synonym standards

2012-07-27 Thread Derek Homeier
On 27.07.2012, at 3:27PM, Benjamin Root wrote: I would prefer not to use: from xxx import *, because of the name pollution. The name convention that I copied above facilitates avoiding the pollution. In the same spirit, I've used: import pylab as plb But in that same spirit,

Re: [Numpy-discussion] Synonym standards

2012-07-27 Thread Derek Homeier
On 27 Jul 2012, at 17:58, Tony Yu wrote: On Fri, Jul 27, 2012 at 11:39 AM, Derek Homeier de...@astro.physik.uni-goettingen.de wrote: On 27.07.2012, at 3:27PM, Benjamin Root wrote: I would prefer not to use: from xxx import *, because of the name pollution. The name

Re: [Numpy-discussion] Synonym standards

2012-07-27 Thread Derek Homeier
On 27.07.2012, at 8:30PM, Fernando Perez fperez@gmail.com wrote: On Fri, Jul 27, 2012 at 9:43 AM, Derek Homeier de...@astro.physik.uni-goettingen.de wrote: thanks, that was exactly what I was looking for - together with c.TerminalIPythonApp.exec_lines = ['import sys

Re: [Numpy-discussion] Simple Loadtxt question

2012-11-28 Thread Derek Homeier
On 29.11.2012, at 1:21AM, Robert Love wrote: I have a file with thousands of lines like this: Signal was returned in 204 microseconds Signal was returned in 184 microseconds Signal was returned in 199 microseconds Signal was returned in 4274 microseconds Signal was returned in 202

Re: [Numpy-discussion] how do I specify maximum line length when using savetxt?

2012-12-05 Thread Derek Homeier
On 06.12.2012, at 12:40AM, Mark Bakker wrote: I guess I wasn't explicit enough. Say I have an array with 100 numbers and I want to write it to a file with 6 numbers on each line (and hence, only 4 on the last line). Can I use savetxt to do that? What other easy tool does numpy have to do

Re: [Numpy-discussion] Trouble building numpy on different version of OSX.

2013-02-14 Thread Derek Homeier
On 14.02.2013, at 3:55PM, Steve Spicklemire st...@spvi.com wrote: I got Xcode 4,6 from the App Store. I don't think it's the SDK since the python 2.7 version builds fine. It's just the 3.2 version that doesn't have the -I/Library/Frameworks/Python.Framework/Versions/3.2/include/python3.2m in

Re: [Numpy-discussion] Please stop bottom posting!!

2013-04-12 Thread Derek Homeier
On 12.04.2013, at 2:14AM, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Apr 11, 2013 at 5:49 PM, Colin J. Williams cjwilliam...@gmail.com wrote: On 11/04/2013 7:20 PM, Paul Hobson wrote: On Wed, Apr 3, 2013 at 4:28 PM, Doug Coleman doug.cole...@gmail.com wrote: Also, gmail

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

2013-05-07 Thread Derek Homeier
Dear Sudheer, On 07.05.2013, at 11:14AM, Sudheer Joseph sudheer.jos...@yahoo.com wrote: I need to print few arrays in a tabular form for example below array IL has 25 elements, is there an easy way to print this as 5x5 comma separated table? in python IL=[] for i in

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

2013-05-10 Thread Derek Homeier
On 10.05.2013, at 1:20PM, Sudheer Joseph sudheer.jos...@yahoo.com wrote: If some one has a quick way I would like to learn from them or get a referecence where the formatting part is described which was my intention while posting here. As I have been using fortran I just tried to use it

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

2013-05-10 Thread Derek Homeier
On 10.05.2013, at 2:51PM, Daniele Nicolodi dani...@grinta.net wrote: If you wish to format numpy arrays preceding them with a variable name, the following is a possible solution that gives the same formatting as in your example: import numpy as np import sys def format(out, v, name):

Re: [Numpy-discussion] genfromtxt and gzip

2013-06-11 Thread Derek Homeier
On 05.06.2013, at 9:52AM, Ted To rainexpec...@theo.to wrote: From the list archives (2011), I noticed that there is a bug in the python gzip module that causes genfromtxt to fail with python 2 but this bug is not a problem for python 3. When I tried to use genfromtxt and python 3 with a

Re: [Numpy-discussion] Removal of numarray and oldnumeric packages.

2013-09-23 Thread Derek Homeier
On 23.09.2013, at 7:03PM, Charles R Harris charlesr.har...@gmail.com wrote: I have gotten no feedback on the removal of the numarray and oldnumeric packages. Consequently the removal will take place on 9/28. Scream now or never... The only thing I'd care about is the nd_image subpackage,

Re: [Numpy-discussion] ANN: NumPy 1.7.2rc1 release

2013-11-12 Thread Derek Homeier
Hi, On 03.11.2013, at 5:42PM, Julian Taylor jtaylor.deb...@googlemail.com wrote: I'm happy to announce the release candidate of Numpy 1.7.2. This is a bugfix only release supporting Python 2.4 - 2.7 and 3.1 - 3.3. on OS X 10.5, build and tests succeed for Python 2.5-3.3, but Python 2.4.4

Re: [Numpy-discussion] ANN: NumPy 1.7.2rc1 release

2013-11-15 Thread Derek Homeier
On 13.11.2013, at 3:07AM, Charles R Harris charlesr.har...@gmail.com wrote: Python 2.4 fixes at https://github.com/numpy/numpy/pull/4049. Thanks for the fixes; builds under OS X 10.5 now as well. There are two test errors (or maybe as nose problem?): NumPy version 1.7.2rc1 NumPy is installed

[Numpy-discussion] genfromtxt universal newline support

2014-06-30 Thread Derek Homeier
Hi all, I was just having a new look into the mess that is, imo, the support for automatic line ending recognition in genfromtxt, and more generally, the Python file openers. I am glad at least reading gzip files is no longer entirely broken in Python3, but actually detecting in particular

Re: [Numpy-discussion] genfromtxt universal newline support

2014-06-30 Thread Derek Homeier
On 30 Jun 2014, at 04:39 pm, Nathaniel Smith n...@pobox.com wrote: On Mon, Jun 30, 2014 at 12:33 PM, Julian Taylor jtaylor.deb...@googlemail.com wrote: genfromtxt and loadtxt need an almost full rewrite to fix the botched python3 conversion of these functions. There are a couple threads

Re: [Numpy-discussion] genfromtxt universal newline support

2014-06-30 Thread Derek Homeier
On 30 Jun 2014, at 04:56 pm, Nathaniel Smith n...@pobox.com wrote: A real need, which had also been discussed at length, is a truly performant text IO function (i.e. one using a compiled ASCII number parser, and optimally also a more memory-efficient one), but unfortunately all people

Re: [Numpy-discussion] genfromtxt universal newline support

2014-06-30 Thread Derek Homeier
On 30.06.2014, at 23:10, Jeff Reback jeffreb...@gmail.com wrote: In pandas 0.14.0, generic whitespace IS parsed via the c-parser, e.g. specifying '\s+' as a separator. Not sure when you were playing last with pandas, but the c-parser has been in place since late 2012. (version 0.8.0)

Re: [Numpy-discussion] problems with mailing list ?

2014-07-18 Thread Derek Homeier
On 18 Jul 2014, at 01:07 pm, josef.p...@gmail.com wrote: Are the problems with sending out the messages with the mailing lists? I'm getting some replies without original messages, and in some threads I don't get replies, missing part of the discussions. There seem to be problems with the

Re: [Numpy-discussion] length - sticks algorithm

2014-07-29 Thread Derek Homeier
On 29 Jul 2014, at 02:43 pm, Robert Kern robert.k...@gmail.com wrote: On Tue, Jul 29, 2014 at 12:47 PM, Josè Luis Mietta joseluismie...@yahoo.com.ar wrote: Robert, thanks for your help! Now I have: * Q nodes (Q stick-stick intersections) * a list 'NODES'=[(x,y,i,j)_1,,

Re: [Numpy-discussion] ANN: NumPy 1.8.2 release candidate

2014-08-05 Thread Derek Homeier
On 5 Aug 2014, at 11:27 pm, Matthew Brett matthew.br...@gmail.com wrote: OSX wheels built and tested and uploaded OK : http://wheels.scikit-image.org https://travis-ci.org/matthew-brett/numpy-atlas-binaries/builds/31747958 Will test against the scipy stack later on today. Built and

Re: [Numpy-discussion] Bug in genfromtxt with usecols and converters

2014-08-26 Thread Derek Homeier
Hi Adrian, I tried to load data from a csv file into numpy using genfromtxt. I need only a subset of the columns and want to apply some conversions to the data. attached is a minimal script showing the error. In brief, I want to load columns 1,2 and 4. But in the converter function for the

Re: [Numpy-discussion] Bug in genfromtxt with usecols and converters

2014-08-26 Thread Derek Homeier
Hi Adrian, not sure whether to call it a bug; the error seems to arise before reading any actual data (even on reading from an empty string); when genfromtxt is checking the filling_values used to substitute missing or invalid data it is apparently testing on default testing values of 1

Re: [Numpy-discussion] Bug in genfromtxt with usecols and converters

2014-08-27 Thread Derek Homeier
On 26 Aug 2014, at 09:05 pm, Adrian Altenhoff adrian.altenh...@inf.ethz.ch wrote: But you are right that the problem with using the first_values, which should of course be valid, somehow stems from the use of usecols, it seems that in that loop for (i, conv) in user_converters.items():

Re: [Numpy-discussion] [SciPy-Dev] ANN: Numpy 1.6.0 beta 1

2011-03-23 Thread Derek Homeier
Hi Bruce, Sorry as I should I have paid more attention to you first email as I raised this on the numpy list. (At least with gmail, the reply is to the scipy-dev list rather than the numpy list.) Based on Pauli's answer I got around it by commenting out a line in the setup.py file

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 1

2011-03-23 Thread Derek Homeier
Hi again, On 23 Mar 2011, at 17:07, Ralf Gommers wrote: I am pleased to announce the availability of the first beta of NumPy 1.6.0. Due to the extensive changes in the Numpy core for this release, the beta testing phase will last at least one month. Please test this beta and report any

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 1

2011-03-23 Thread Derek Homeier
On 24 Mar 2011, at 00:34, Derek Homeier wrote: tests with the fink-installed pythons on MacOS X mostly succeeded, with one failure in python2.4 and a couple of issues seemingly related to PPC floating point accuracy, as below: Probably last update for tonight: with the 'full' test suite

Re: [Numpy-discussion] how to delete a particular column or row from numpy array based on some rule or value

2011-03-24 Thread Derek Homeier
In a numpy array of m x n size, I would like to delete few rows when a given element in that row is ‘nan’ or say any other value. For e.g. as in example given below, if I wish to delete a row when the 3rd element of row is zero, or if 3rd, 4th, 5th element are zero or either of 3rd,

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 1

2011-03-24 Thread Derek Homeier
On 24.03.2011, at 9:11AM, Pearu Peterson wrote: Intel-64bit: ERROR: test_assumed_shape.TestAssumedShapeSumExample.test_all -- Traceback (most recent call last): File /sw/lib/python3.2/site-packages/nose/case.py, line 372,

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Derek Homeier
Hi, On 26 Mar 2011, at 14:36, Pauli Virtanen wrote: On Sat, 26 Mar 2011 13:11:46 +0100, Paul Anton Letnes wrote: [clip] I hope you find this useful! Is there some way of submitting the patches for review in a more convenient fashion than e-mail? You can attach them on the trac to each

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Derek Homeier
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 behavior would probably break old code, Seems the fastest

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-26 Thread Derek Homeier
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 ticket #1562, but I did not test that yet. Tested, see

Re: [Numpy-discussion] Old tickets

2011-03-30 Thread Derek Homeier
On 30 Mar 2011, at 23:26, Benjamin Root wrote: Ticket 301: 'Make power and divide return floats from int inputs (like true_divide)' http://projects.scipy.org/numpy/ticket/301 Invalid because the output dtype is the same as the input dtype unless you override using the dtype argument:

Re: [Numpy-discussion] Old tickets

2011-03-30 Thread Derek Homeier
Hi, On 30 Mar 2011, at 21:37, Bruce Southey wrote: Ticket 1071: 'loadtxt fails if the last column contains empty value' http://projects.scipy.org/numpy/ticket/1071 Invalid mainly because loadtxt states that 'Each row in the text file must have the same number of values.' So of cause loadtxt

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-03-31 Thread Derek Homeier
On 31 Mar 2011, at 17:03, Bruce Southey wrote: This is an invalid ticket because the docstring clearly states that in 3 different, yet critical places, that missing values are not handled here: Each row in the text file must have the same number of values. genfromtxt : Load data with

Re: [Numpy-discussion] How to create structured char arrays?

2011-04-04 Thread Derek Homeier
Hi Bruce, I think that I have resolved my issue down to creating a structured string array. I am using numpy version '2.0.0.dev-3c338cb'. Without a structured array, it should be a 2 by 2 array: np.array([('a','b'),('c','d')]) array([['a', 'b'], ['c', 'd']], dtype='|S1')

Re: [Numpy-discussion] python3 setup.py install fails with git maint/1.6.x

2011-04-04 Thread Derek Homeier
On 4 Apr 2011, at 21:41, Darren Dale wrote: Just tried again with python3.2 and 1.6.0b2, installs fine. The line it fails on is only reached when a numpy/version.py exists, which is the case for source releases or if you did not clean your local git repo before building. ... but I think

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 2

2011-04-04 Thread Derek Homeier
Hi all, On 4 Apr 2011, at 22:04, Ralf Gommers wrote: I am pleased to announce the availability of the second beta of NumPy 1.6.0. Due to the extensive changes in the Numpy core for this release, the beta testing phase will last at least one month. Please test this beta and report any

Re: [Numpy-discussion] strange behavior of np.minimum and np.maximum

2011-04-06 Thread Derek Homeier
Hi Emmanuelle, a, b, c = np.array([10]), np.array([2]), np.array([7]) min_val = np.minimum(a, b, c) min_val array([2]) max_val = np.maximum(a, b, c) max_val array([10]) min_val array([10]) (I'm using numpy 1.4, and I observed the same behavior with numpy 2.0.0.dev8600 on another

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

2011-05-03 Thread Derek Homeier
Hi Ralf, I am pleased to announce the availability of the second release candidate of NumPy 1.6.0. Compared to the first release candidate, one segfault on (32-bit Windows + MSVC) and several memory leaks were fixed. If no new problems are reported, the final release will be in one week.

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

2011-05-04 Thread Derek Homeier
On 04.05.2011, at 8:42PM, Ralf Gommers wrote: == FAIL: test_return_character.TestF90ReturnCharacter.test_all -- Traceback (most recent call last): File

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-04 Thread Derek Homeier
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, since the function caller can simply call

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-04 Thread Derek Homeier
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 reuse them? Perhaps it's overkill, and perhaps it will reintroduce the 'transposed' problem? Yes, good point, one could replace the X.shape =

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-05 Thread Derek Homeier
On 5 May 2011, at 22:53, Derek Homeier wrote: However, the problem that ndmin is supposed to address is not fixed by the current implementation for the rc. Essentially, a single- row, multi-column file with ndmin=2 comes out as a Nx1 array which is the same result for a multi-row, single

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-06 Thread Derek Homeier
On 6 May 2011, at 07:53, Ralf Gommers wrote: Looks okay, and I agree that it's better to fix it now. The timing is a bit unfortunate though, just after RC2. I'll have closer look tomorrow and if it can go in, probably tag RC3. If in the meantime a few more people could test this, that

Re: [Numpy-discussion] Creating a 1-d structured array

2011-05-13 Thread Derek Homeier
Hi, just a comment since I first thought the solution below might not be what Bruce was looking for, but having realised it's probably what he's been asking for... On 13 May 2011, at 17:20, josef.p...@gmail.com wrote: On Fri, May 13, 2011 at 10:58 AM, Bruce Southey bsout...@gmail.com

Re: [Numpy-discussion] Creating a 1-d structured array

2011-05-13 Thread Derek Homeier
On 13 May 2011, at 22:04, josef.p...@gmail.com wrote: Thus I am wondering why broadcasting should not be possible in this case, Even a 1 column table is still a table (or a list of records), and a 1 item row is still a row. True, but even multiplying the shape (6, ) array e.g. with a shape

Re: [Numpy-discussion] How can Import DATA from a Fortran file

2011-05-18 Thread Derek Homeier
On 19.05.2011, at 12:47AM, Aradenatorix Veckhom Vacelaevus wrote: I have a file in simple text with information obtained in Fortran 77 and I need to use the data inside for visualize with Mayavi. I was fighting for a while with the VTK simple legacy format. Finally I could run an small

Re: [Numpy-discussion] Numpy question

2011-05-26 Thread Derek Homeier
On 26 May 2011, at 11:17, Talla wrote: Below is the output of the coammands you mentioned. C:\python Python 2.6.2 (r262:71600, Jul 7 2009, 20:21:09) [MSC v.1500 32 bit (Intel)] on win3 Type help, copyright, credits or license for more information. import numpy print(numpy.arange(3))

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-31 Thread Derek Homeier
Hi Chris, On 31 May 2011, at 13:56, cgraves wrote: I've downloaded the latest numpy (1.6.0) and loadtxt has the ndmin option, however neither genfromtxt nor recfromtxt, which use loadtxt, have it. Should they have inherited the option? Who can make it happen? you are mistaken, genfromtxt

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-31 Thread Derek Homeier
On 31 May 2011, at 17:33, Bruce Southey wrote: It certainly would make sense to provide the same functionality for genfromtxt (which should then be inherited by [nd,ma,rec]fromtxt), so I'd go ahead and file a feature (enhancement) request. I can't promise I can take care of it myself,

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-31 Thread Derek Homeier
On 31 May 2011, at 17:45, Benjamin Root wrote: At this point, I wonder if it might be smarter to create a .atleast_Nd() function and use that everywhere it is needed. Having similar logic tailored for each loading function might be a little dangerous if bug fixes are made to one, but

Re: [Numpy-discussion] loadtxt ndmin option

2011-05-31 Thread Derek Homeier
On 31 May 2011, at 18:25, Pierre GM wrote: On May 31, 2011, at 5:52 PM, Derek Homeier wrote: I think stuff like multiple delimiters should have been dealt with before, as the right place to insert the ndmin code (which includes the decision to squeeze or not to squeeze as well as to add

Re: [Numpy-discussion] ANN: Numpy 1.6.1 release candidate 1

2011-06-13 Thread Derek Homeier
Hi Ralf, I am pleased to announce the availability of the first release candidate of NumPy 1.6.1. This is a bugfix release, list of fixed bugs: #1834 einsum fails for specific shapes #1837 einsum throws nan or freezes python for specific array shapes #1838 object - structured type

Re: [Numpy-discussion] ANN: Numpy 1.6.1 release candidate 1

2011-06-13 Thread Derek Homeier
Hi Ralf, FAIL: Test custom format function for each element in array. -- This test is not in 1.6.x, only in master. I suspect the same is true for the datetime tests, but perhaps not for the S5/U5 thing. Can you clean

Re: [Numpy-discussion] ANN: Numpy 1.6.1 release candidate 1

2011-06-13 Thread Derek Homeier
On 13.06.2011, at 6:19PM, Ralf Gommers wrote: I used wget using the direct link and it eventually got the complete file after multiple tries. Yes, SF is having a pretty bad day. I eventually also got the tarball through the fink/debian mirror list; no failures on OS X 10.5 i386. There

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-06-15 Thread Derek Homeier
On 15.06.2011, at 1:34AM, Mark Wiebe wrote: These functions are now fully implemented and documented. As always, code reviews are welcome here: https://github.com/numpy/numpy/pull/87 and for those that don't want to dig into review C code, the commit for the documentation is here:

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-06-16 Thread Derek Homeier
Hi Mark, On 16.06.2011, at 5:40PM, Mark Wiebe wrote: np.datetime64('2011-06-16 02:03:04Z', 'D') np.datetime64('-06-16','D') I've tried to track this down in datetime.c, but unsuccessfully so (i.e. I could not connect it to any of the dts-year assignments therein). This is

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-06-16 Thread Derek Homeier
On 17.06.2011, at 2:02AM, Mark Wiebe wrote: ok, that was a lengthy hunt, but it's in printing the string in make_iso_8601_date: tmplen = snprintf(substr, sublen, %04 NPY_INT64_FMT, dts-year); fprintf(stderr, printed %d[%d]: dts-year=%lld: %s\n, tmplen, sublen, dts-year, substr);

Re: [Numpy-discussion] code review/build test for datetime business day API

2011-06-17 Thread Derek Homeier
On 17.06.2011, at 8:05PM, Mark Wiebe wrote: On Thu, Jun 16, 2011 at 8:18 PM, Derek Homeier de...@astro.physik.uni-goettingen.de wrote: On 17.06.2011, at 2:02AM, Mark Wiebe wrote: ok, that was a lengthy hunt, but it's in printing the string in make_iso_8601_date: tmplen

Re: [Numpy-discussion] genfromtxt converter question

2011-06-17 Thread Derek Homeier
Hi Gary, On 17.06.2011, at 5:39PM, gary ruben wrote: Thanks for the hints Olivier and Bruce. Based on them, the following is a working solution, although I still have that itchy sense that genfromtxt should be able to do it directly. import numpy as np from StringIO import StringIO a =

Re: [Numpy-discussion] genfromtxt converter question

2011-06-17 Thread Derek Homeier
On 17.06.2011, at 11:01PM, Olivier Delalleau wrote: You were just overdoing it by already creating an array with the converter, this apparently caused genfromtxt to create a structured array from the input (which could be converted back to an ndarray, but that can prove tricky as well) -

Re: [Numpy-discussion] genfromtxt converter question

2011-06-18 Thread Derek Homeier
On 18 Jun 2011, at 04:48, gary ruben wrote: Thanks guys - I'm happy with the solution for now. FYI, Derek's suggestion doesn't work in numpy 1.5.1 either. For any developers following this thread, I think this might be a nice use case for genfromtxt to handle in future. Numpy 1.6.0 and above

[Numpy-discussion] Enhancements and bug fix for npyio

2011-06-18 Thread Derek Homeier
Hi, in my experience numbers loaded from text files very often require identical conversion for all data (e.g. parsing Fortran-style double precision, or German vs. English decimals...). Yet loadtxt and genfromtxt in such cases require the user to construct a dictionary of converters for

Re: [Numpy-discussion] loadtxt ndmin option

2011-06-19 Thread Derek Homeier
On 31 May 2011, at 21:28, Pierre GM wrote: On May 31, 2011, at 6:37 PM, Derek Homeier wrote: On 31 May 2011, at 18:25, Pierre GM wrote: On May 31, 2011, at 5:52 PM, Derek Homeier wrote: I think stuff like multiple delimiters should have been dealt with before, as the right place to insert

Re: [Numpy-discussion] ANN: Numpy 1.6.1 release candidate 1

2011-06-19 Thread Derek Homeier
Hi Ralf, On 19 Jun 2011, at 12:28, Ralf Gommers wrote: numpy.test('full') Running unit tests for numpy NumPy version 1.6.1rc1 NumPy is installed in /sw/lib/python3.2/site-packages/numpy Python version 3.2 (r32:88445, Mar 1 2011, 18:28:16) [GCC 4.0.1 (Apple Inc. build 5493)] nose

Re: [Numpy-discussion] npyio - gzip 271 Error -3 while decompressing ?

2011-06-20 Thread Derek Homeier
Moin Denis, On 20 Jun 2011, at 19:04, denis wrote: a separate question, have you run genfromtxt( xx.csv.gz ) lately ? I haven't, and I was not particularly involved with it before this patch, so this would possibly be better addressed to the list. On on

Re: [Numpy-discussion] fast numpy i/o

2011-06-21 Thread Derek Homeier
On 21.06.2011, at 7:58PM, Neal Becker wrote: I think, in addition, that hdf5 is the only one that easily interoperates with matlab? speaking of hdf5, I see: pyhdf5io 0.7 - Python module containing high-level hdf5 load and save functions. h5py 2.0.0 - Read and write HDF5 files from

Re: [Numpy-discussion] fast numpy i/o

2011-06-27 Thread Derek Homeier
On 27.06.2011, at 6:36PM, Robert Kern wrote: Some late comments on the note (I was a bit surprised that HDF5 installation seems to be a serious hurdle to many - maybe I've just been profiting from the fink build system for OS X here - but I also was not aware that the current netCDF is

Re: [Numpy-discussion] broacasting question

2011-06-30 Thread Derek Homeier
On 30.06.2011, at 7:32PM, Thomas K Gamble wrote: I'm trying to convert some IDL code to python/numpy and i'm having some trouble understanding the rules for boradcasting during some operations. example: given the following arrays: a = array((2048,3577), dtype=float) b =

Re: [Numpy-discussion] broacasting question

2011-06-30 Thread Derek Homeier
On 30.06.2011, at 11:57PM, Thomas K Gamble wrote: np.add(b.reshape(2048,3136) * c, d, out=a[:,:3136]) But to say whether this is really the equivalent result to what IDL does, one would have to study the IDL manual in detail or directly compare the output (e.g. check what happens to the

Re: [Numpy-discussion] ANN: NumPy 1.6.1 release candidate 2

2011-07-08 Thread Derek Homeier
On 07.07.2011, at 7:16PM, Robert Pyle wrote: .../Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/numeric.py:1922: RuntimeWarning: invalid value encountered in absolute return all(less_equal(absolute(x-y), atol + rtol * absolute(y)))

Re: [Numpy-discussion] Can I index array starting with 1?

2011-07-28 Thread Derek Homeier
On 29.07.2011, at 1:19AM, Stéfan van der Walt wrote: On Thu, Jul 28, 2011 at 4:10 PM, Anne Archibald aarch...@physics.mcgill.ca wrote: Don't forget the everything-looks-like-a-nail approach: make all your arrays one bigger than you need and ignore element zero. Hehe, why didn't I think of

Re: [Numpy-discussion] Can I index array starting with 1?

2011-07-28 Thread Derek Homeier
On 29.07.2011, at 1:38AM, Anne Archibald wrote: The can is open and the worms are everywhere, so: The big problem with one-based indexing for numpy is interpretation. In python indexing, -1 is the last element of the array, and ranges have a specific meaning. In a hypothetical one-based

Re: [Numpy-discussion] Segmentation Fault in Numpy.test()

2011-08-02 Thread Derek Homeier
On 2 Aug 2011, at 18:57, Thomas Markovich wrote: It appears that uninstalling python 2.7 and installing the scipy superpack with the apple standard python removes the Did the superpack installer automatically install numpy to the python2.7 directory when present? Even if so, I reckon you

Re: [Numpy-discussion] Finding many ways to incorrectly create a numpy array. Please advice

2011-08-02 Thread Derek Homeier
On 2 Aug 2011, at 19:15, Christopher Barker wrote: In [32]: s = numpy.array(a, dtype=tfc_dtype) --- TypeError Traceback (most recent call last) /Users/cbarker/ipython console in

[Numpy-discussion] longlong format error with Python = 2.6 in scalartypes.c

2011-08-04 Thread Derek Homeier
Hi, commits c15a807e and c135371e (thus most immediately addressed to Mark, but I am sending this to the list hoping for more insight on the issue) introduce a test failure with Python 2.5+2.6 on Mac: FAIL: test_timedelta_scalar_construction (test_datetime.TestDateTime)

  1   2   >