Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Gökhan Sever
On Wed, Oct 7, 2009 at 12:47 AM, Pierre GM wrote: > > On Oct 7, 2009, at 1:12 AM, Gökhan Sever wrote: > > One more from me: > > I[1]: a = np.arange(5) > > I[2]: mask = 999 > > I[6]: a[3] = 999 > > I[7]: am = ma.masked_equal(a, mask) > > > > I[8]: am > > O[8]: > > masked_array(data = [0 1 2 -- 4],

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Pierre GM
On Oct 7, 2009, at 1:12 AM, Gökhan Sever wrote: > One more from me: > I[1]: a = np.arange(5) > I[2]: mask = 999 > I[6]: a[3] = 999 > I[7]: am = ma.masked_equal(a, mask) > > I[8]: am > O[8]: > masked_array(data = [0 1 2 -- 4], > mask = [False False False True False], >fill_val

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Gökhan Sever
On Tue, Oct 6, 2009 at 11:33 PM, Pierre GM wrote: > > On Oct 7, 2009, at 12:10 AM, Gökhan Sever wrote: > > > Created the ticket http://projects.scipy.org/numpy/ticket/1253 > > Want even more confusion ? > >>> x = ma.array([1,2,3],mask=[0,1,0], dtype=int) > >>> x[0].dtype > dtype('int64') > >>>

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Pierre GM
On Oct 7, 2009, at 12:10 AM, Gökhan Sever wrote: > Created the ticket http://projects.scipy.org/numpy/ticket/1253 Want even more confusion ? >>> x = ma.array([1,2,3],mask=[0,1,0], dtype=int) >>> x[0].dtype dtype('int64') >>> x[1].dtype dtype('float64') >>> x[2].dtype dtype('int64') Yet anot

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Gökhan Sever
Created the ticket http://projects.scipy.org/numpy/ticket/1253 Could you tell me briefly what was the source of leak in arccos case? And how do you write a test code for these cases? On Tue, Oct 6, 2009 at 10:15 PM, Pierre GM wrote: > > On Oct 6, 2009, at 10:58 PM, Gökhan Sever wrote: > > > >

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Gökhan Sever
On Tue, Oct 6, 2009 at 10:15 PM, Pierre GM wrote: > > On Oct 6, 2009, at 10:58 PM, Gökhan Sever wrote: > > > > I see your points. I don't want to give you extra work, don't > > worry :) It just seem a bit bizarre: > > > > I[27]: c.data['Air_Temp'].fill_value > > O[27]: 99.005 > > > >

Re: [Numpy-discussion] genfromtxt - the return

2009-10-06 Thread Pierre GM
On Oct 6, 2009, at 11:01 PM, Skipper Seabold wrote: > > In keeping with the making some work for you theme, I filed an > enhancement ticket for one change that we discussed and another IMO > useful addition. http://projects.scipy.org/numpy/ticket/1238 > > I think it would be nice if we could do >

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Pierre GM
On Oct 6, 2009, at 10:58 PM, Gökhan Sever wrote: > > I see your points. I don't want to give you extra work, don't > worry :) It just seem a bit bizarre: > > I[27]: c.data['Air_Temp'].fill_value > O[27]: 99.005 > > I[28]: c.data['Air_Temp'][4].fill_value > O[28]: 1e+20 > > As you see

Re: [Numpy-discussion] genfromtxt - the return

2009-10-06 Thread Skipper Seabold
On Tue, Oct 6, 2009 at 10:27 PM, Pierre GM wrote: >> Anyhow, I am really impressed on how this function works. > > Thx. I hope things haven't been slowed down too much. In keeping with the making some work for you theme, I filed an enhancement ticket for one change that we discussed and another

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Gökhan Sever
On Tue, Oct 6, 2009 at 9:22 PM, Pierre GM wrote: > > On Oct 6, 2009, at 9:54 PM, Gökhan Sever wrote: > > > > > Also say, if I want to replace that one element back to its original > > > state will it use fill_value as 1e+20 or 99.? > > > > What do you mean by 'replace back to its original

Re: [Numpy-discussion] genfromtxt - the return

2009-10-06 Thread Skipper Seabold
On Tue, Oct 6, 2009 at 10:08 PM, Bruce Southey wrote: > On Tue, Oct 6, 2009 at 4:04 PM, Pierre GM wrote: >> >> On Oct 6, 2009, at 4:43 PM, Christopher Barker wrote: >> >>> Pierre GM wrote: > I think that the default invalid_raise should be True. Mmh, OK, that's a +1/) for invalid_ra

Re: [Numpy-discussion] genfromtxt - the return

2009-10-06 Thread Pierre GM
On Oct 6, 2009, at 10:08 PM, Bruce Southey wrote: > No, just seeing what sort of problems I can create. This case is > partly based on if someone is using tab-delimited then they need to > set the delimiter='\t' otherwise it gives an error. Also I often parse > text files so, yes, you have to be c

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Pierre GM
On Oct 6, 2009, at 9:54 PM, Gökhan Sever wrote: > > > Also say, if I want to replace that one element back to its original > > state will it use fill_value as 1e+20 or 99.? > > What do you mean by 'replace back to its original state' ? Using > `filled`, you mean ? > > Yes, in more properly

Re: [Numpy-discussion] genfromtxt - the return

2009-10-06 Thread Bruce Southey
On Tue, Oct 6, 2009 at 4:04 PM, Pierre GM wrote: > > On Oct 6, 2009, at 4:43 PM, Christopher Barker wrote: > >> Pierre GM wrote: I think that the default invalid_raise should be True. >>> >>> Mmh, OK, that's a +1/) for invalid_raise=true. Anybody else ? >> >> yup -- make it +2 -- ignoring err

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Pierre GM
On Oct 6, 2009, at 6:57 PM, Gökhan Sever wrote: > > Seeing a different filling value is causing confusion. Both for > myself, and when I try to demonstrate the usage of masked array to > other people. Also say, if I want to replace that one element back > to its original state will it use fi

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Gökhan Sever
On Tue, Oct 6, 2009 at 7:38 PM, Pierre GM wrote: > > On Oct 6, 2009, at 6:57 PM, Gökhan Sever wrote: > > Seeing a different filling value is causing confusion. Both for > > myself, and when I try to demonstrate the usage of masked array to > > other people. > > Fair enough. I must admit that `fil

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Pierre GM
On Oct 6, 2009, at 6:57 PM, Gökhan Sever wrote: > Seeing a different filling value is causing confusion. Both for > myself, and when I try to demonstrate the usage of masked array to > other people. Fair enough. I must admit that `fill_value` is a vestige from the previous implementation (t

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Gökhan Sever
On Tue, Oct 6, 2009 at 4:28 PM, Pierre GM wrote: > > On Oct 6, 2009, at 4:42 PM, Gökhan Sever wrote: > > > Hello, > > > > I have a sample masked array data as shown below. > > > > 1-) When I list the whole array I see the fill value correctly. > > However below that line, when I do access the 5th

Re: [Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Pierre GM
On Oct 6, 2009, at 4:42 PM, Gökhan Sever wrote: > Hello, > > I have a sample masked array data as shown below. > > 1-) When I list the whole array I see the fill value correctly. > However below that line, when I do access the 5th element, > fill_value flies upto 1e+20. What might be wrong he

Re: [Numpy-discussion] genfromtxt - the return

2009-10-06 Thread Pierre GM
On Oct 6, 2009, at 4:43 PM, Christopher Barker wrote: > Pierre GM wrote: >>> I think that the default invalid_raise should be True. >> >> Mmh, OK, that's a +1/) for invalid_raise=true. Anybody else ? > > yup -- make it +2 -- ignoring erreos and losing data by default is a > "bad idea"! OK then,

Re: [Numpy-discussion] tostring() for array rows

2009-10-06 Thread josef . pktd
On Tue, Oct 6, 2009 at 4:39 PM, Christopher Barker wrote: > josef.p...@gmail.com wrote: >> If I have a structured or a regular array, is the use of strides in >> the following always correct for the length of the row memory? >> >> I would like to do tostring() but on each row, by creating a string

[Numpy-discussion] vectorize() broken on Python2.6

2009-10-06 Thread George Trojan
f2py generated wrappers cannot be vectorized with numpy1.3.0 and Python2.6.2. The reason is change to Python's getargs.c. Vectorize, or rather _get_nargs() defined in lib/function_base.py tries to determine the number of arguments from error message generated while the interpreter parses function i

Re: [Numpy-discussion] genfromtxt - the return

2009-10-06 Thread Christopher Barker
Pierre GM wrote: >> I think that the default invalid_raise should be True. > > Mmh, OK, that's a +1/) for invalid_raise=true. Anybody else ? yup -- make it +2 -- ignoring erreos and losing data by default is a "bad idea"! >> One 'feature' is that there is no way to indicate multiple delimiters

[Numpy-discussion] Questions about masked arrays

2009-10-06 Thread Gökhan Sever
Hello, I have a sample masked array data as shown below. 1-) When I list the whole array I see the fill value correctly. However below that line, when I do access the 5th element, fill_value flies upto 1e+20. What might be wrong here? I[5]: c.data['Air_Temp'] O[5]: masked_array(data = [13.1509 1

Re: [Numpy-discussion] tostring() for array rows

2009-10-06 Thread Christopher Barker
josef.p...@gmail.com wrote: > If I have a structured or a regular array, is the use of strides in > the following always correct for the length of the row memory? > > I would like to do tostring() but on each row, by creating a string > view of the memory in a 1d array. Maybe I'm missing what you

Re: [Numpy-discussion] genfromtxt - the return

2009-10-06 Thread Pierre GM
On Oct 6, 2009, at 2:42 PM, Bruce Southey wrote: >> > Hi, > Excellent as the changes appear to address incorrect number of > delimiters. They should also give some extra info if there's a problem w/ the converters. > I think that the default invalid_raise should be True. Mmh, OK, that's a +

Re: [Numpy-discussion] genfromtxt - the return

2009-10-06 Thread Bruce Southey
On 10/05/2009 02:13 PM, Pierre GM wrote: > All, > Could you try r7449 ? I introduced some mechanisms to keep track of > invalid lines (where the number of columns don't match what's > expected). By default, a warning is emitted and these lines are > skipped, but an optional argument gives the possi

Re: [Numpy-discussion] Tabular data package

2009-10-06 Thread Dan Yamins
> > I didn't see any explicit nan handling. Are missing values allowed > e.g. in the constructor? > No, this is a valid point. We don't handle this as explicitly as we should. Are you mostly talking about nan handling in loading from delimited text files? (Or are you talking about something mo

[Numpy-discussion] tostring() for array rows

2009-10-06 Thread josef . pktd
If I have a structured or a regular array, is the use of strides in the following always correct for the length of the row memory? I would like to do tostring() but on each row, by creating a string view of the memory in a 1d array. Thanks, Josef >>> tmp = np.random.randn(4,3) >>> tmp.ravel().

Re: [Numpy-discussion] NumPy SVN broken

2009-10-06 Thread Charles R Harris
On Tue, Oct 6, 2009 at 11:14 AM, David Cournapeau wrote: > On Wed, Oct 7, 2009 at 2:04 AM, Charles R Harris > wrote: > > > > > > On Tue, Oct 6, 2009 at 10:50 AM, David Cournapeau > > wrote: > >> > >> On Wed, Oct 7, 2009 at 1:36 AM, Charles R Harris > >> wrote: > >> > > >> > > >> > 2009/10/6 Sté

Re: [Numpy-discussion] NumPy SVN broken

2009-10-06 Thread David Warde-Farley
On 6-Oct-09, at 12:50 PM, David Cournapeau wrote: > The version itself is fine, but the ABI has been changed in an > incompatible way: if you have an extension built against say numpy > 1.2.1, and then use a numpy built from sources after the datetime > merge, it will segfault right away. It does

Re: [Numpy-discussion] NumPy SVN broken

2009-10-06 Thread David Cournapeau
On Wed, Oct 7, 2009 at 2:04 AM, Charles R Harris wrote: > > > On Tue, Oct 6, 2009 at 10:50 AM, David Cournapeau > wrote: >> >> On Wed, Oct 7, 2009 at 1:36 AM, Charles R Harris >> wrote: >> > >> > >> > 2009/10/6 Stéfan van der Walt >> >> >> >> Hi all, >> >> >> >> The current SVN HEAD of NumPy is

Re: [Numpy-discussion] NumPy SVN broken

2009-10-06 Thread Charles R Harris
On Tue, Oct 6, 2009 at 10:50 AM, David Cournapeau wrote: > On Wed, Oct 7, 2009 at 1:36 AM, Charles R Harris > wrote: > > > > > > 2009/10/6 Stéfan van der Walt > >> > >> Hi all, > >> > >> The current SVN HEAD of NumPy is broken and should not be used. > >> Extensions compiled against this version

Re: [Numpy-discussion] Tabular data package

2009-10-06 Thread josef . pktd
On Tue, Oct 6, 2009 at 12:31 PM, wrote: > On Mon, Oct 5, 2009 at 5:22 PM, Elaine Angelino > wrote: >> Hi there, >> >> We are writing to announce the release of "Tabular", a package of Python >> modules for working with tabular data. >> >> Tabular is a package of Python modules for working with t

Re: [Numpy-discussion] NumPy SVN broken

2009-10-06 Thread David Cournapeau
On Wed, Oct 7, 2009 at 1:36 AM, Charles R Harris wrote: > > > 2009/10/6 Stéfan van der Walt >> >> Hi all, >> >> The current SVN HEAD of NumPy is broken and should not be used. >> Extensions compiled against this version may (will) segfault. >> > > Can you be more specific? I haven't had any probl

Re: [Numpy-discussion] NumPy SVN broken

2009-10-06 Thread Stéfan van der Walt
2009/10/6 Charles R Harris : > 2009/10/6 Stéfan van der Walt >> >> Hi all, >> >> The current SVN HEAD of NumPy is broken and should not be used. >> Extensions compiled against this version may (will) segfault. >> > > Can you be more specific? I haven't had any problems running current svn > with s

Re: [Numpy-discussion] NumPy SVN broken

2009-10-06 Thread Charles R Harris
2009/10/6 Stéfan van der Walt > Hi all, > > The current SVN HEAD of NumPy is broken and should not be used. > Extensions compiled against this version may (will) segfault. > > Can you be more specific? I haven't had any problems running current svn with scipy. Chuck _

Re: [Numpy-discussion] Tabular data package

2009-10-06 Thread josef . pktd
On Mon, Oct 5, 2009 at 5:22 PM, Elaine Angelino wrote: > Hi there, > > We are writing to announce the release of "Tabular", a package of Python > modules for working with tabular data. > > Tabular is a package of Python modules for working with tabular data. Its > main object is the tabarray class

Re: [Numpy-discussion] NumPy SVN broken

2009-10-06 Thread Charles R Harris
2009/10/6 Stéfan van der Walt > Hi all, > > The current SVN HEAD of NumPy is broken and should not be used. > Extensions compiled against this version may (will) segfault. > > Travis, if you could have a look at the side-effects caused by r7050, > that would be great. I meant to figure out what

Re: [Numpy-discussion] Tabular data package

2009-10-06 Thread Bruce Southey
On 10/05/2009 06:20 PM, Robert Kern wrote: > On Mon, Oct 5, 2009 at 18:15, Elaine Angelino > wrote: > > >>> Well, what other recarray functionality are you using? >>> >> None, in our code. We also thought that since at least some people like >> using the attribute reference property

Re: [Numpy-discussion] Tabular data package

2009-10-06 Thread Elaine Angelino
On Mon, Oct 5, 2009 at 7:20 PM, Robert Kern wrote: > On Mon, Oct 5, 2009 at 18:15, Elaine Angelino > wrote: > > > Then I would suggest making tabarrays subclass from ndarray. > Ok, done.We did it using the from*() function design you suggested. In the future, if there are more direct from*

[Numpy-discussion] NumPy SVN broken

2009-10-06 Thread Stéfan van der Walt
Hi all, The current SVN HEAD of NumPy is broken and should not be used. Extensions compiled against this version may (will) segfault. Travis, if you could have a look at the side-effects caused by r7050, that would be great. I meant to figure out what was wrong, but seeing that this is a 3000 li