[Numpy-discussion] scipy.io.loadmat incompatible with Numpy 1.0.2

2007-04-09 Thread Ryan May
Error: 'numpy.ndarray' object has no attribute 'strip' Reverting to numpy 1.0.1 works fine for the same code. So the question is, does scipy need an update, or did something unintended creep into Numpy 1.0.2? (Hence the cross-post) Ryan -- Ryan May Graduate Research A

Re: [Numpy-discussion] scipy.io.loadmat incompatible with Numpy 1.0.2

2007-04-09 Thread Ryan May
Travis Oliphant wrote: > Ryan May wrote: > >> Hi, >> >> As far as I can tell, the new Numpy 1.0.2 broke scipy.io.loadmat. >> >> > Yes, it was the one place that scipy used the fact that field selection > of a 0-d array returned a scalar. This has be

[Numpy-discussion] 16bit Integer Array/Scalar Inconsistency

2007-08-02 Thread Ryan May
ncy with scalar operation made debugging my problem more difficult. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman

Re: [Numpy-discussion] Accessing a numpy array in a mmap fashion

2007-08-30 Thread Ryan May
you're looking for is numpy.memmap, though the documentation is eluding me at the moment. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Convert array type

2007-10-08 Thread Ryan May
ace is ignored). Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Governance model request

2015-09-22 Thread Ryan May
This has to be one of the most bizarre threads I've ever read in my life. Somehow companies are lurking around like the boogeyman and academics are completely free of ulterior motives and conflicts of interest? This is just asinine--we're all people and have various motivations. (Having just gotten

Re: [Numpy-discussion] Python needs goto

2015-09-25 Thread Ryan May
On Fri, Sep 25, 2015 at 3:02 PM, Nathaniel Smith wrote: > > The coroutines in 3.5 are just syntactic sugar around features that were > added in *2*.5 (yield expressions and yield from), so no need to wait :-). > They fall far short of arbitrary continuations, though. > Correction: Python 3.4 gain

Re: [Numpy-discussion] Cython-based OpenMP-accelerated quartic polynomial solver

2015-10-02 Thread Ryan May
rden Street, MS 83 > phone: (617) 496-7981 Cambridge, MA 02138-1516 > cell: (781) 363-0035 USA > > > > ___ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > https://mail.scipy.org/mailman/listinfo/numpy-discussion > > -- Ryan May ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Scipy 2016 attending

2016-05-18 Thread Ryan May
WA 98115 (206) 526-6317 main reception > chris.bar...@noaa.gov > > ___ > NumPy-Discussion mailing > listNumPy-Discussion@scipy.orghttps://mail.scipy.org/mailman/listinfo/numpy-discussion > > > > > ____

[Numpy-discussion] Custom Dtype/Units discussion

2016-07-09 Thread Ryan May
one way or another before I can move forward in my corner of the world, and I have time I can dedicate to implementing a solution. Ryan -- Ryan May ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Custom Dtype/Units discussion

2016-07-10 Thread Ryan May
n the Python Compilers Workshop > and my talk, but do you want to meet up Thursday maybe? > > -n > > On Sat, Jul 9, 2016 at 6:44 PM, Ryan May wrote: > > Greetings! > > > > I've been beating my head against a wall trying to work seamlessly with > > pint's

Re: [Numpy-discussion] Custom Dtype/Units discussion

2016-07-10 Thread Ryan May
on? > > Nathan > > > On Sunday, July 10, 2016, Ryan May wrote: > >> Hi Nathaniel, >> >> Thursday works for me; anyone else interested is welcome to join. >> >> Ryan >> >> On Sun, Jul 10, 2016 at 12:20 AM, Nathaniel Smith wrote: >>

Re: [Numpy-discussion] Custom Dtype/Units discussion

2016-07-11 Thread Ryan May
ral solution is a good goal--just that units is my "sine qua non". Also, I would have love to have heard that someone solved the unit + ndarray-like thing problem. :) Ryan -- Ryan May ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.o

Re: [Numpy-discussion] Custom Dtype/Units discussion

2016-07-13 Thread Ryan May
ystem generally, rather than specifically about unit support. (though unit > support is a great use-case to focus on) > > So Thursday's options seem to be in the standard BOF slot (up against the Numfocus BOF), or doing something that evening, which would overlap at least part of multipl

Re: [Numpy-discussion] Custom Dtype/Units discussion

2016-07-14 Thread Ryan May
Fine with me. Ryan On Thu, Jul 14, 2016 at 12:48 AM, Nathaniel Smith wrote: > I have something at lunch, so dinner would be good for me too. > On Jul 13, 2016 7:46 PM, "Charles R Harris" > wrote: > >> Evening would work for me. Dinner? >> On Jul 13, 2016 2:4

Re: [Numpy-discussion] Custom Dtype/Units discussion

2016-07-14 Thread Ryan May
Sounds good. On Thu, Jul 14, 2016 at 10:51 AM, Nathan Goldbaum wrote: > Fine with me as well. Meet in the downstairs lobby after the lightning > talks? > > On Thu, Jul 14, 2016 at 10:49 AM, Ryan May wrote: > >> Fine with me. >> >> Ryan >> >> On T

Re: [Numpy-discussion] Integers to negative integer powers, time for a decision.

2016-10-10 Thread Ryan May
On Sun, Oct 9, 2016 at 12:59 PM, Stephan Hoyer wrote: > On Sun, Oct 9, 2016 at 6:25 AM, Sebastian Berg > wrote: > >> For what its worth, I still feel it is probably the only real option to >> go with error, changing to float may have weird effects. Which does not >> mean it is impossible, I admi

Re: [Numpy-discussion] How to use user input as equation directly

2016-10-27 Thread Ryan May
eval function: https://docs.python.org/3/library/functions.html#eval ? Ryan -- Ryan May ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] array comprehension

2016-11-04 Thread Ryan May
ment, so it can work similarly to np.stack. > itertools.product, itertools.permutation, etc. with np.fromiter (and reshape) is probably also useful here, though it doesn't solve the non-scalar problem. Ryan -- Ryan May ___ NumPy-Discussi

Re: [Numpy-discussion] numpy.trapz() doesn't respect subclass

2010-03-27 Thread Ryan May
On Mon, Mar 22, 2010 at 8:14 AM, Ryan May wrote: > On Sun, Mar 21, 2010 at 11:57 PM,   wrote: >> On Mon, Mar 22, 2010 at 12:49 AM, Ryan May wrote: >>> Hi, >>> >>> I found that trapz() doesn't work with subclasses: >>> >>> http://

Re: [Numpy-discussion] numpy.trapz() doesn't respect subclass

2010-03-27 Thread Ryan May
On Sat, Mar 27, 2010 at 11:12 AM, wrote: > On Sat, Mar 27, 2010 at 1:00 PM, Ryan May wrote: >> On Mon, Mar 22, 2010 at 8:14 AM, Ryan May wrote: >>> On Sun, Mar 21, 2010 at 11:57 PM,   wrote: >>>> On Mon, Mar 22, 2010 at 12:49 AM, Ryan May wrote: >>&g

Re: [Numpy-discussion] numpy.trapz() doesn't respect subclass

2010-03-27 Thread Ryan May
nterface code.) Yeah, it's kind of annoying, since the 10% is the cool part you want, and that 90% is thorny to design and boring to code. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] numpy.trapz() doesn't respect subclass

2010-03-29 Thread Ryan May
On Mon, Mar 29, 2010 at 8:00 AM, Bruce Southey wrote: > On 03/27/2010 01:31 PM, Ryan May wrote: >> Because of the call to asarray(), the mask is completely discarded and >> you end up with identical results to an unmasked array, >> which is not what I'd expect.  Worse, t

Re: [Numpy-discussion] numpy.trapz() doesn't respect subclass

2010-03-29 Thread Ryan May
think this addresses the concerns that were raised about the changes for subclasses in this case. Let me know if I've missed something (or if there's no way in hell any such patch will ever be committed). Thanks, Ryan -- Ryan May Graduate Research Assistant School of Meteorology Un

Re: [Numpy-discussion] Making a 2to3 distutils command ?

2010-03-30 Thread Ryan May
here > are probably simple ways to do it without mixing distutils in. Out of curiosity, is there something wrong with the support for 2to3 that already exists within distutils? (Other than it just being distutils) http://bruynooghe.blogspot.com/2010/03/using-lib2to3-in-setuppy.htm

Re: [Numpy-discussion] Set values of a matrix within a specified range to zero

2010-03-30 Thread Ryan May
On Tue, Mar 30, 2010 at 11:12 AM, Alan G Isaac wrote: > On 3/30/2010 12:56 PM, Sean Mulcahy wrote: >> 512x512 arrays.  I would like to set elements of the array whose value fall >> within a specified range to zero (eg 23<  x<  45). > > x[(23http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Set values of a matrix within a specified range to zero

2010-03-30 Thread Ryan May
On Tue, Mar 30, 2010 at 3:16 PM, Friedrich Romstedt wrote: > 2010/3/30 Ryan May : >> On Tue, Mar 30, 2010 at 11:12 AM, Alan G Isaac wrote: >>> On 3/30/2010 12:56 PM, Sean Mulcahy wrote: >>>> 512x512 arrays.  I would like to set elements of the array whose value

Re: [Numpy-discussion] Set values of a matrix within a specified range to zero

2010-03-30 Thread Ryan May
On Tue, Mar 30, 2010 at 3:40 PM, Robert Kern wrote: > On Tue, Mar 30, 2010 at 16:35, Ryan May wrote: >> On Tue, Mar 30, 2010 at 3:16 PM, Friedrich Romstedt >> wrote: > >>> x *= ((x <= 23) | (x >= 45))  . >> >> Interesting. In an ideal world, I&#x

Re: [Numpy-discussion] Bug in logaddexp2.reduce

2010-03-31 Thread Ryan May
t;license" for more information. >>> import numpy as np >>> np.logaddexp2(-0.5849625007211563, -53.584962500721154) -0.58496250072115619 >>> np.logaddexp2(-1.5849625007211563, -53.584962500721154) -1.5849625007211561 >>> np.version.version '2.0.0.dev8313' R

Re: [Numpy-discussion] Is this odd?

2010-04-02 Thread Ryan May
pty > array and non-empty array( irrespective to what is inside array). But by using: if not b[0]: You're not considering the array as a whole, you're looking at the first element, which is giving expected results. As I'm sure you're aware,

Re: [Numpy-discussion] Is this odd?

2010-04-02 Thread Ryan May
On Fri, Apr 2, 2010 at 8:31 AM, Robert Kern wrote: > On Fri, Apr 2, 2010 at 08:28, Ryan May wrote: >> On Thu, Apr 1, 2010 at 10:07 PM, Shailendra >> wrote: >>> Hi All, >>> Below is some array behaviour which i think is odd >>>>>> a=arange(1

Re: [Numpy-discussion] Another masked array question

2010-05-08 Thread Ryan May
; fails. Although single assignment works: > > I[13]: basic.data['Air_Temp'].data[0] = 30 > > Shouldn't this be working like the regular NumPy arrays do? Based on the traceback, I'd say it's because you're trying to replace the object pointed to by the .data at

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Ryan May
tion--it strips away information contained in the class, and IMHO should not be the default behavior. If I want the objects, I can force it: In [7]: np.array([a,b],dtype=np.object) Out[7]: array([2.0 m, 1.0 s], dtype=object) This works fine, but feels ugly since I have to explicitly tell numpy

Re: [Numpy-discussion] BOF notes: Fernando's proposal: NumPy?ndarray with named axes

2010-07-12 Thread Ryan May
C somewhere, at least at the BOF, this exact syntax was intended to be supported. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] conversion to 1D array of specified dtype

2010-08-31 Thread Ryan May
),dtype='d') works but seems cumbersome atleast_1d(d).astype('d') Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Question about masked arrays

2010-09-20 Thread Ryan May
g about using asanyarray(). If you encounter a basic numpy function that calls asarray() but would work fine with masked arrays (or other subclasses), feel free to file/post as a bug. It's good to get those cases fixed where possible. (I've done this in t

Re: [Numpy-discussion] A proposed change to rollaxis() behavior for negative 'start' values

2010-09-23 Thread Ryan May
)).shape > Out[8]: (3, 4, 5, 6, 2) > > So it behaves just like insert. But "len(a.shape)" is rather > cumbersome, especially if you haven't given a a name yet: It's available as a.ndim Ryan -- Ryan May Graduate Rese

Re: [Numpy-discussion] min() of array containing NaN

2008-08-15 Thread Ryan May
re, but this seems like a better use for masked arrays, not NaN's. Masked arrays were specifically designed to add functions that work well with masked/invalid data points. Why reinvent the wheel here? Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Okl

[Numpy-discussion] BUG in numpy.loadtxt?

2008-09-04 Thread Ryan May
rray([[ 2., 3.], [ 5., 6.]]) Was it a conscious design decision that the usecols no longer accept arrays? The new behavior (in 1.1.1) breaks existing code that one of my colleagues has. Can we get a patch in before 1.2 to get this working with arrays again? Thanks, Ryan --

Re: [Numpy-discussion] BUG in numpy.loadtxt?

2008-09-04 Thread Ryan May
Travis E. Oliphant wrote: > Ryan May wrote: >> Stefan (or anyone else who can comment), >> >> It appears that the usecols argument to loadtxt no longer accepts numpy >> arrays: >> > > Could you enter a ticket so we don't lose track of this. I

Re: [Numpy-discussion] BUG in numpy.loadtxt?

2008-09-05 Thread Ryan May
r side ? > I can confirm that it works fine for me. Can you or someone else backport this to the 1.2 branch so that this bug is fixed in the next release? Thanks, Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___

Re: [Numpy-discussion] BUG in numpy.loadtxt?

2008-09-05 Thread Ryan May
Thanks a bunch for getting these done. David Huard wrote: > Done in r5790. > > On Fri, Sep 5, 2008 at 12:36 PM, Ryan May <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > David Huard wrote: > > Hi Ryan, > > > > I appl

Re: [Numpy-discussion] profiling line by line

2008-09-18 Thread Ryan May
machine. > > I am telling you all the time Robert to use Debian that it just works > and you say, no no, gentoo is the best. :) And what's wrong with that? :) Once you get over the learning curve, Gentoo works just fine. Must be Robert K.'s fault. :) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] A bug in loadtxt and how to convert a string array (hex data) to decimal?

2008-09-18 Thread Ryan May
'3c7']], > > > dtype='|S3') > It's because of how numpy handles strings arrays (which I admit I don't understand very well.) Basically, it's converting the numbers properly, but truncating them to 3 characters. Try this, which just forces it to expand to strings 4 c

Re: [Numpy-discussion] Array shape

2008-10-03 Thread Ryan May
you have? For an array object A, A.shape should give the shape you're expecting. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Need **working** code example of 2-D arrays

2008-10-13 Thread Ryan May
a curt answer, it certainly wasn't meant to > be rude. Many of us also sprinkle our responses with a liberal dose > of Tongue In Cheek :) > > It looks like you received some good answers to your question, but let > us know if your problems persist and we'll help you sort it

[Numpy-discussion] Loadtxt .bz2 support

2008-10-21 Thread Ryan May
Hi, I noticed numpy.loadtxt has support for gzipped text files, but not for bz2'd files. Here's a 3 line patch to add bzip2 support to loadtxt. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Index: numpy

Re: [Numpy-discussion] Loadtxt .bz2 support

2008-10-22 Thread Ryan May
Charles R Harris wrote: > On Tue, Oct 21, 2008 at 1:30 PM, Ryan May <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> I noticed numpy.loadtxt has support for gzipped text files, but not for >> bz2'd files. Here's a 3 line patch to add bzip2 support to loadtx

Re: [Numpy-discussion] numpy array change notifier?

2008-10-27 Thread Ryan May
7;notify:', args > > > with also overriding setslice? I haven't given this much thought, but you'd also likely need to do this for the infix operators (+=, etc.). Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Matlib docstring typos

2008-11-12 Thread Ryan May
for fixing/adding small things like this.) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Matlib docstring typos

2008-11-12 Thread Ryan May
Pauli Virtanen wrote: > Hi, > > Wed, 12 Nov 2008 10:16:35 -0600, Ryan May wrote: >> Here's a quick diff to fix some typos in the docstrings for matlib.zeros >> and matlib.ones. They're causing 2 (of many) failures in the doctests >> for me on SVN HEAD. >

Re: [Numpy-discussion] setting element

2008-11-12 Thread Ryan May
he index goes, that would be: def setval(array, index, value, axis=0): slices = [slice(None)] * len(array.shape) slices[axis] = index array[slices] = value (Adapted from the code for numpy.diff) Ryan -- Ryan May Graduate Research Assista

[Numpy-discussion] numpy.loadtxt requires seek()?

2008-11-20 Thread Ryan May
aise a TypeError if it's incompatible. Thoughts? I'm willing to write up the patch for either . Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] numpy.loadtxt requires seek()?

2008-11-20 Thread Ryan May
Stéfan van der Walt wrote: > 2008/11/20 Ryan May <[EMAIL PROTECTED]>: >> Does anyone know why numpy.loadtxt(), in checking the validity of a >> filehandle, checks for the seek() method, which appears to have no >> bearing on whether an object will work? > > I thi

[Numpy-discussion] More loadtxt() changes

2008-11-25 Thread Ryan May
in this code requires a bit of boilerplace (declaring dtypes, converters). While it's nothing I can't write, it still would be easier to write it once within loadtxt and have it for everyone. Any support for *any* of these ideas? Any suggestions on how the user should pass in the informatio

Re: [Numpy-discussion] More loadtxt() changes

2008-11-25 Thread Ryan May
27;m currently cooking up some of these changes myself, but thought I would see what you thought first. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] More loadtxt() changes

2008-11-25 Thread Ryan May
Pierre GM wrote: > On Nov 25, 2008, at 2:06 PM, Ryan May wrote: >> 1) It looks like the function returns a structured array rather than a >> rec array, so that fields are obtained by doing a dictionary access. >> Since it's a dictionary access, is there any reason that

Re: [Numpy-discussion] More loadtxt() changes

2008-11-25 Thread Ryan May
> On Nov 25, 2008, at 2:37 PM, Ryan May wrote: >> What about doing the parsing and type inference in a loop and holding >> onto the already split lines? Then loop through the lines with the >> converters that were finally chosen? In addition to making my usecase >> wo

Re: [Numpy-discussion] More loadtxt() changes

2008-11-25 Thread Ryan May
urned by np.loadtxt() (by masking on the appropriate fill value)? >> I'll post that when I'm done and we can see if it looks like too much >> functionality stapled together or not. > > Sounds like a plan. Wouldn't mind getting more feedback from fellow > user

Re: [Numpy-discussion] More loadtxt() changes

2008-11-25 Thread Ryan May
lcome any and all suggestions here, both on the code and on the original idea of adding these capabilities to loadtxt(). Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma Index: lib/io.py ===

Re: [Numpy-discussion] More loadtxt() changes

2008-11-25 Thread Ryan May
d converter function fails, the user should know. (Though I got this wrong the first time.) > * I'd probably get rid of StringConverter._get_from_dtype, as it is not > needed outside the __init__. You may wanna stick to the original __init__. Done. R

Re: [Numpy-discussion] More loadtxt() changes

2008-11-25 Thread Ryan May
Pierre GM wrote: > On Nov 25, 2008, at 10:02 PM, Ryan May wrote: >> Pierre GM wrote: >>> * Your locked version of update won't probably work either, as you >>> force >>> the converter to output a string (you set the status to largest >>> possibl

[Numpy-discussion] Minimum dtype

2008-11-25 Thread Ryan May
ifying dtype=numpy.float32 or dtype=numpy.int32. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] More loadtxt() changes

2008-11-25 Thread Ryan May
Pierre GM wrote: On Nov 25, 2008, at 10:02 PM, Ryan May wrote: Pierre GM wrote: * Your locked version of update won't probably work either, as you force the converter to output a string (you set the status to largest possible, that's the one that outputs strings). Why don

Re: [Numpy-discussion] More loadtxt() changes

2008-11-26 Thread Ryan May
John Hunter wrote: > On Tue, Nov 25, 2008 at 11:23 PM, Ryan May <[EMAIL PROTECTED]> wrote: > >> Updated patch attached. This includes: >> * Updated docstring >> * New tests >> * Fixes for previous issues >> * Fixes to make new tests actually wo

Re: [Numpy-discussion] More loadtxt() changes

2008-11-26 Thread Ryan May
Manuel Metz wrote: > Ryan May wrote: >> 3) Better support for missing values. The docstring mentions a way of >> handling missing values by passing in a converter. The problem with this is >> that you have to pass in a converter for *every column* that will contain >&

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-01 Thread Ryan May
ile and get a structured array with an automatically detected dtype (names and types!) plus masked values. My $0.02. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Ryan May
of loadtxt(), feel free to use it. I'm more than capable of wrapping the urlopen() object within a StringIO. However, I am unconvinced that removing the 2nd loop and instead redoing the reading from the file will be much (if any) of a speed win. Ryan -- Ryan

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Ryan May
d as the delimiter, but when an explicit delimiter has been > provided, it strikes me that the code shouldn't try to further- > interpret it... > > Does anyone else have any opinion here? I agree. If the user explicity passes something as a delimiter, we should use it and not try to be too smart. +1 Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Ryan May
who sees certain casing of names in the file and expects that data to be laid out the same. Other than those, it's working fine for me here. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussi

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-03 Thread Ryan May
object arrays, or rather, a field containing objects, specifically datetime objects? Right now, this does not work because calling view does not work for object arrays. I'm just looking for a simple way to store date/time in my record array (currently a string field). Ryan --

Re: [Numpy-discussion] genloadtxt: second serving

2008-12-04 Thread Ryan May
more than welcome, > as usual. > > Anyhow: as we do need speed, I suggest we put genloadtxt somewhere in > numpy.ma, with an alias recfromcsv for John, using his defaults. Unless > somebody comes with a brilliant optimization. Why only in numpy.ma and not somewhere in core numpy itsel

Re: [Numpy-discussion] genloadtxt : last call

2008-12-08 Thread Ryan May
ge. > > And so, now what ? Should I put the module in numpy.lib.io ? Elsewhere ? > > Thx for any comment and suggestions. Current version works out of the box for me. Thanks for running point on this. Ryan -- Ryan May Graduate Research Assistant School

[Numpy-discussion] Unexpected MaskedArray behavior

2008-12-16 Thread Ryan May
>>b.data array([ 5, 10, 15, 20, 25]) I was expecting that the underlying data wouldn't get modified while masked. Is this actual behavior expected? Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma __

Re: [Numpy-discussion] genloadtxt : last call

2008-12-16 Thread Ryan May
re against the converted value from the file to determine if missing. (Probably very slow) 2) Add a list of objects (ints, floats, etc.) to compare against after conversion to determine if they're missing. This might needlessly complicate the function, which I know you've alrea

Re: [Numpy-discussion] genloadtxt : last call

2008-12-17 Thread Ryan May
ere that calling it loadtxt would be a disservice to how much the new function can do (and how much work you've done). Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion m

Re: [Numpy-discussion] Unexpected MaskedArray behavior

2008-12-17 Thread Ryan May
Pierre GM wrote: > On Dec 16, 2008, at 1:57 PM, Ryan May wrote: >> I just noticed the following and I was kind of surprised: >> >>>>> a = ma.MaskedArray([1,2,3,4,5], mask=[False,True,True,False,False]) >>>>> b = a*5 >>>>> b >> maske

Re: [Numpy-discussion] Alternative to record array

2008-12-29 Thread Ryan May
ata = np.empty(N, dtype=dt) data['age'] = np.random.randint(0, 99, 10e6) data['weight'] = np.random.randint(0, 200, 10e6) data['age'] += 1 Timing for recarrays (your code): In [10]: timeit data.age += 1 10

Re: [Numpy-discussion] Numpy performance vs Matlab.

2009-01-07 Thread Ryan May
; a[i,j,2] = a[i,j,0] > a[i,j,1] = a[i,j,2] > > end = time.clock() - start > > print "Test done, %f sec" % end > # > Any idea on it ? > Did I missed something ? I think you may have reduced the complexity a bit too much. The python cod

[Numpy-discussion] Pattern for reading non-simple binary files

2009-01-23 Thread Ryan May
go along? Any insight would be appreciated. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Bug with mafromtxt

2009-01-24 Thread Ryan May
x27;2,5', dtype=None) print a.dtype Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Bug with mafromtxt

2009-01-24 Thread Ryan May
y. On one hand I'd love for things to behave differently in this case, but on the other I understand why things work this way. Ryan > > On Jan 24, 2009, at 5:58 PM, Ryan May wrote: > >> Pierre, >> >> I've found what I consider to be a bug in the new mafromtxt

Re: [Numpy-discussion] Bug with mafromtxt

2009-01-26 Thread Ryan May
Pierre GM wrote: > On Jan 24, 2009, at 6:23 PM, Ryan May wrote: >> Ok, thanks. I've dug a little further, and it seems like the >> problem is that a >> column of all missing values ends up as a column of all None's. >> When you create >> a (mask

Re: [Numpy-discussion] numpy ndarray questions

2009-01-26 Thread Ryan May
a = a+1 > > a.ctypes.data points to a different memory location (this is actually an > even bigger problem when executing fftw plans), however > type(a) still gives me . This might help some: http://www.scipy.org/Subclasses Ryan -- Ryan May Graduate Res

[Numpy-discussion] recfunctions.stack_arrays

2009-01-27 Thread Ryan May
dtype and I'll try to put together a patch. Thanks, Ryan P.S. Thanks so much for your work on putting those utility functions in recfunctions.py It makes it so much easier to have these functions available in the library itself rather than needing to reinvent the wheel over and over.

Re: [Numpy-discussion] recfunctions.stack_arrays

2009-01-27 Thread Ryan May
,2,3)], mask=[(0,1,0)], dtype=[(('a','A'),int), (('b','B'),bool), (('c','C'),float)]) >>> b = ma.array([(4,5,6)], dtype=[(('a','A'),int), (('b','B'),float), (('c','C'),floa

Re: [Numpy-discussion] minor improvment to ones

2009-01-30 Thread Ryan May
ill with > zeros. Anything else is counter-intuitive. Calling numpy.ones to fill > with fives makes no sense to me. But I would be +1 on having a function > called numpy.values or numpy.fill that would create and fill an ndarray > with arbitrary values. I completely agree here. R

Re: [Numpy-discussion] minor improvment to ones

2009-01-30 Thread Ryan May
e tricks? I think I remember some > discussion of this a while back. I think that's right, but at that point, what gain is that over using a regular constant and relying on numpy's broadcasting? Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma _

Re: [Numpy-discussion] example reading binary Fortran file

2009-01-30 Thread Ryan May
ot sure about whether or not its optimized, but I can tell you that the "mystery" 4 bytes are the number of bytes it that wrote out followed by that number of bytes of data. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Fortran binary files and numpy/scipy

2009-02-02 Thread Ryan May
number of bytes that will follow, *then* the actual data. So, for instance, the first write to file in your program will write the bytes corresponding to these values: 16 X(1) Y(1) Z(1) The 16 comes from the size of 2 ints and 1 double. Since you're always writing out the 3 values, and

Re: [Numpy-discussion] Fortran binary files and numpy/scipy

2009-02-02 Thread Ryan May
Nils Wagner wrote: > On Mon, 02 Feb 2009 10:17:13 -0600 > Ryan May wrote: >> Every write statement in fortran first writes out the >> number of bytes that will >> follow, *then* the actual data. So, for instance, the >> first write to file in >&g

Re: [Numpy-discussion] Fortran binary files and numpy/scipy

2009-02-02 Thread Ryan May
3.4484552433329538e-313), > (0, 16, 0, 5.2413296037731544e-312), > (0, 1077805056, 16, 3.3951932655444357e-313), (0, > 19, 246, 27.0), > (16, 0, 16, 4.2439915819305446e-313), > (245, 0, 1077411840, 7.9050503334599447e-323)], >dtype=[('isize

Re: [Numpy-discussion] Fortran binary files and numpy/scipy

2009-02-02 Thread Ryan May
Nils Wagner wrote: > On Mon, 02 Feb 2009 14:07:35 -0600 > Ryan May wrote: >> Nils Wagner wrote: >>>>> Is this a 64-bit problem ? >>>>> >>>> I don't know if it's a 64-bit problem per-se, so much as >>>> a d

[Numpy-discussion] genloadtxt question

2009-02-03 Thread Ryan May
: time data did not match format: data=0 fmt=%Y-%m-%d %H:%M:%SZ Which comes from a part of the code in updating converters where it passes the string '0' to the converter. Are the converters expected to handle what amounts to bad input even though the file itself has no such

Re: [Numpy-discussion] genloadtxt question

2009-02-03 Thread Ryan May
Pierre GM wrote: > On Feb 3, 2009, at 11:24 AM, Ryan May wrote: > >> Pierre, >> >> Should the following work? >> >> import numpy as np >> from StringIO import StringIO >> >> converter = {'date':lambda s: datetime.strptime(s,'%

Re: [Numpy-discussion] Operations on masked items

2009-02-03 Thread Ryan May
Ryan May wrote: > Pierre, > > I know you did some preliminary work on helping to make sure that doing > operations on masked arrays doesn't change the underlying data. I ran into > the > following today. > > import numpy as np > a = np.ma.array([1,2,3], mask=[F

[Numpy-discussion] Operations on masked items

2009-02-03 Thread Ryan May
values end up with the value of the scalar. If this is getting too hairy to handle not touching data, I understand. I just thought I should point out the inconsistency here. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University o

Re: [Numpy-discussion] Operations on masked items

2009-02-03 Thread Ryan May
Pierre GM wrote: > On Feb 3, 2009, at 4:00 PM, Ryan May wrote: >> Well, I guess I hit send too soon. Here's one easy solution >> (consistent with >> what you did for __radd__), change the code for __rmul__ to do: >> >> return multiply(self, othe

[Numpy-discussion] Argsort

2009-02-05 Thread Ryan May
Hi, Ok, what am I missing here: x = np.array([[4,2],[5,3]]) x[x.argsort(1)] array([[[5, 3], [4, 2]], [[5, 3], [4, 2]]]) I was expecting: array([[2,4],[3,5]]) Certainly not a 3D array. What am I doing wrong? Ryan -- Ryan May Graduate Research Assistant School of

Re: [Numpy-discussion] PEP: named axis

2009-02-06 Thread Ryan May
t want to make any assumptions, it becomes the > > user's responsibility to do it manually. > > I don't think there is *any* sane way of numpy propagating the user's > metadata. The user must be the one to do it. > I'm +1 on all of what Robert said.

  1   2   >