Re: [Numpy-discussion] dealing with datetime UTC vs linear time

2011-06-06 Thread Matt Knox
sively with relational databases (sql server, mysql, etc) and all (most?) of the python database adapters use python datetime objects when passing data back and forth from the database to python. So people wanting to analyze date / time series data from relational databases in n

Re: [Numpy-discussion] Subclassing ma.MaskedArray

2010-03-16 Thread Matt Knox
David Carmean halibut.com> writes: > > > I understand that ma.MaskedArray is a subclass of ndarray; in addition to > the requirements for subclassing the latter, what does ma.MaskedArray add to > the list? I.e. what do I have to watch out for? You may want to take a look at the TimeSeries cl

Re: [Numpy-discussion] C-api and masked arrays

2010-03-01 Thread Matt Knox
Martin Raspaud smhi.se> writes: > We are using at the moment a c extension which should manipulate masked > arrays. > What we do is to fill the masked array with a given value (say 65535 if we run > uint16 arrays), do the manipulation, and convert back to masked arrays when we > go back to pytho

Re: [Numpy-discussion] add xirr to numpy financial functions?

2009-05-25 Thread Matt Knox
gmail.com> writes: > So, while python won't get any "industrial strength" finance package, > a more modest "designer package" would be feasible, if there were any > interest in it (which I haven't seen). > > ... > > The even more modest question is whether we would want to match open > office i

Re: [Numpy-discussion] add xirr to numpy financial functions?

2009-05-25 Thread Matt Knox
forgive me for jumping in on this thread and playing devil's advocate here, but I am a natural pessimist so please bear with me :) ... I think as this discussion has already demonstrated, it is *extremely* difficult to build a solid general purpose API for financial functions (even seemingly simpl

Re: [Numpy-discussion] Are masked arrays slower for process ing than ndarrays?

2009-05-13 Thread Matt Knox
> Robert Kern gmail.com> writes: > > seterr() uses thread-local storage. Oh. I stand corrected. Ignore my earlier objections then. > Pierre GM gmail.com> writes: > > Also, importing numpy.ma currently calls numpy.seterr(all='ignore') > anyway... hmm. While this doesn't affect me personally..

Re: [Numpy-discussion] Are masked arrays slower for process ing than ndarrays?

2009-05-13 Thread Matt Knox
Hi Pierre, > Here's the catch: it's basically cheating. I got rid of the pre- > processing (where a mask was calculated depending on the domain and > the input set to a filling value depending on this mask, before the > actual computation). Instead, I force > np.seterr(divide='ignore',inva

Re: [Numpy-discussion] The date/time dtype and the casting issue

2008-07-30 Thread Matt Knox
>> >> If it's really just weekdays why not call it that instead of using a >> >> term like business days that (quite confusingly) suggests holidays >> >> are handled properly? >> >> Well, we were adopting the name from the TimeSeries package. Perhaps >> the authors can answer this better than me.

Re: [Numpy-discussion] RFC: A (second) proposal for i mplementing some date/time types in NumPy

2008-07-25 Thread Matt Knox
>> For this goal, we are proposing a decoupling of the date/time use cases >> in two different groups: >> >> 1. A pure ``datetime`` dtype (absolute or relative) that would be useful >> for timestamping purposes in general (i.e. registering dates without a >> need that they be evenly spaced in ti

Re: [Numpy-discussion] NumPy date/time types and the resolu tion concept

2008-07-16 Thread Matt Knox
> Maybe you are right, but by providing many resolutions we are trying to > cope with the needs of people that are using them a lot. In > particular, we are willing that the authors of the timseries scikit can > find on these new dtype a fair replacement of their Date class (our > proposal wil

Re: [Numpy-discussion] RFC: A proposal for implementing s ome date/time types in NumPy

2008-07-12 Thread Matt Knox
Christopher Barker noaa.gov> writes: >> I'm also imaging some extra utility functions/method that would be nice: >> >> aDateTimeArray.hours(dtype=float) >> >> to convert to hours (and days, and seconds, etc). And maybe some that >> would create a DateTimeArray from various time units. The Dat

[Numpy-discussion] SphinxDocString class in new numpy doc framework

2008-06-29 Thread Matt Knox
I guess this question is mostly for Stefan... but I am trying to port the scikits.timeseries module wiki documentation into a sphinx framework, and also trying to follow the numpy doc string standards (which can't be parsed directly by sphinx), so I'm trying to use the SphinxDocString class in doc

Re: [Numpy-discussion] numpy.test() (failures=2, errors=3)

2008-05-24 Thread Matt Knox
> == > ERROR: test_hdquantiles > (numpy.ma.tests.test_morestats.TestQuantiles) > -- You have some kind of franken-build going on there. test_morestats has long s

Re: [Numpy-discussion] Outputting arrays.

2008-05-21 Thread Matt Knox
> 1. Is there a module or other code to write arrays to databases (they want access databases)? There are three python odbc modules (mxODBC, ceODBC, pyodbc), all of which should allow you to connect to access databases. I've played around with all three and my personal favourite is ceODBC (which i

Re: [Numpy-discussion] 1.1.0rc1, Win32 Installer: please test it (test errors)

2008-05-21 Thread Matt Knox
> installed fine and all tests ran successfully on my machine. I spoke too soon. I didn't know about the "all" parameter in numpy.test and just ran if with the default before. When I specify all=True, I get 12 errors. Most of which seem to be related to a problem with calling the "tolist" method.

Re: [Numpy-discussion] 1.1.0rc1, Win32 Installer: please test it

2008-05-20 Thread Matt Knox
David Cournapeau ar.media.kyoto-u.ac.jp> writes: > > Hi, > > Sorry for the delay, but it is now ready: numpy "superpack" > installers for numpy 1.1.0rc1: > > http://www.ar.media.kyoto-u.ac.jp/members/david/archives/numpy-1.1.0rc1-win32-superpack-python2.5.exe > http://www.ar.media.kyoto-u

Re: [Numpy-discussion] bug with with fill_values in maske d arrays?

2008-03-21 Thread Matt Knox
Chris, The behaviour you are seeing is intentional. Pierre is correct in asserting that it is not a bug. Now, you may disagree with the behaviour, but the behaviour is by design and is not a bug. Perhaps you are misunderstanding how to use masked arrays, which is understandable because the documen

Re: [Numpy-discussion] bug with with fill_values in maske d arrays?

2008-03-19 Thread Matt Knox
> > OK, my specific problem with masked arrays is as follows: > > >>> a = numpy.array([1,numpy.nan,2]) > >>> aa = numpy.ma.masked_where(numpy.isnan(a),a) > >>> aa > array(data = > [ 1.e+00 1.e+20 2.e+00], >mask = > [False True False], >fill_val

[Numpy-discussion] location of ma in maskedarray branch

2008-01-22 Thread Matt Knox
I noticed that the new masked array module resides in numpy/ma in the maskedarray branch as opposed to numpy/core/ma like it does in the current trunk. Was this intentional? Code that explicitly imports ma from the core subfolder will break from this change (like the __init__.py script for the

Re: [Numpy-discussion] trailing max

2007-10-30 Thread Matt Knox
eries package in the scipy SVN ? We (Matt Knox > and I) tried to address some of these issues for environmental and financial > time series. > http://www.scipy.org/SciPyPackages/TimeSeries > I have just added a trailing max and trailing min function to the timeseries package to g

Re: [Numpy-discussion] Maskedarray implementations

2007-08-25 Thread Matt Knox
I think it's reasonably safe to say at this point that most people are in favor of the new maskedarray implementation becoming the default numpy.ma at some point in the future. So the question is, when/how will the migration process be done? - just swap the whole thing as is and hope for the b

Re: [Numpy-discussion] [SciPy-user] median filter with clipping

2007-05-17 Thread Matt Knox
> I'm inclined to move his masked array over to ma wholesale. The fact > that Pierre sees it as his baby is very important to me. If it doesn't > have significant compatibility issues than I'm all for it. I'm mainly > interested in hearing how people actually using numpy.ma would respond. >

Re: [Numpy-discussion] pretty printing record array element - datetime

2007-05-15 Thread Matt Knox
> I have a numpy record array and I want to pretty print a single > element. I was trying to loop over the names in the element dtype and > use getattr to access the field value, but I got fouled up because > getattr is trying to access the dtype attribute of one of the python > objects (datetime.

Re: [Numpy-discussion] Big list of Numpy & Scipy users

2007-04-09 Thread Matt Knox
Andrew Straw astraw.com> writes: > > Bill Baxter wrote: > > On 4/4/07, Robert Kern gmail.com> wrote: > > > >> Bill Baxter wrote: > >> > >>> Is there any place on the Wiki that lists all the known software that > >>> uses Numpy in some way? > >>> > >>> > It would be nice to s

[Numpy-discussion] thread safe subclasses of ndarray

2007-02-06 Thread Matt Knox
Sturla Molden brought up a point in an earlier thread ("Please help with subclassing numpy.ndarray") that I think is worth highlighting. A "common" approach to subclassing ndarray in python (http://www.scipy.org/Subclasses) results in code that is not thread safe. This approach involves setting

Re: [Numpy-discussion] classmethods for ndarray

2007-02-02 Thread Matt Knox
> Would this break previously saved pickles, so you couldn't load them? I ran into > that problem last year when there was a change to numpy. Is that something that > would happen here? > > bb > Regardless of whether or not this change will "break pickles", it seems hi

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray -?followup

2007-01-19 Thread Matt Knox
> Moving the implementation to the C-level also has its downside. To > me, at least, Python code is much more readable and hence easier to > maintain. > > Is there a way that we can implement only the speed-critical methods > in C? > > Cheers > Stéfan > Implementing the whole thing in C also h

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray - followup

2007-01-19 Thread Matt Knox
> That time series module sounds very interesting! Is it available > somewhere, or some documentation? > > Thank you, > Sven > Not really any documentation yet, and the code is still in a state of flux, so expect frequent changes/additions at this point still. No concern is being given to "bac

Re: [Numpy-discussion] ANN: MaskedArray as a subclass of ndarray - followup

2007-01-18 Thread Matt Knox
> This makes sense to me. I'm generally favorable to the new maskedarray > (I actually like the idea of it being a sub-class). I'm just waiting > for people that actually use the MaskedArray to comment. > > For 1.1 I would really like to move most of the often-used sub-classes > of the ndarr

Re: [Numpy-discussion] custom accumlators

2007-01-05 Thread Matt Knox
> Are you sure about this? I ran this case using timeit, and the first one > was 5 times or so *faster* than the second case. I just dug around and > frompyfunc is acutally implemented in C, although it has to call back > into python to execute the function being vectorized. Can you try using >

Re: [Numpy-discussion] custom accumlators

2007-01-05 Thread Matt Knox
> >> > > You might want to look at frompyfunc: > > > > def expmave2(x, k): > > def expmave_sub(a, b): > > return a + k * (b - a) > > return np.frompyfunc(expmave_sub, 2, 1).accumulate(x) > > > > > > It's amazing what you find when you dig around.

Re: [Numpy-discussion] custom accumlators

2007-01-05 Thread Matt Knox
> > On Friday 05 of January 2007 17:42, Matt Knox wrote: > > - > > Example 1 - exponential moving average: > > > > # naive brute force method... > > def expmave(x, k): > > result = numpy.array(x, copy=T

[Numpy-discussion] custom accumlators

2007-01-05 Thread Matt Knox
--- Is their a good way to do these kinds of things without python looping? Or is that going to require writing a ufunc in C? Any help is greatly appreciated. Thanks, - Matt Knox ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://p

[Numpy-discussion] efficient way to get first index of first masked/non-masked value in a masked array

2006-12-01 Thread Matt Knox
all I can come up with is dumb brute force methods by iterating through all the values. Anyone got any tricks I can use? Thanks, - Matt Knox ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo