Pierre Raybaut | 1 Jan 2010 14:43

Re: [Numpy-discussion] Announcing toydist, improving distribution and packaging situation

Hi David,

Following your announcement for the 'toydist' module, I think that
your project is very promising: this is certainly a great idea and it
will be very controversial but that's because people expectactions are
great on this matter (distutils is so disappointing indeed).

Anyway, if I may be useful, I'll gladly contribute to it.
In time, I could change the whole Python(x,y) packaging system (which
is currently quite ugly... but easy/quick to manage/maintain) to
use/promote this new module.

Happy New Year!
and Long Live Scientific Python! ;-)

Cheers,
Pierre
Tom K. | 2 Jan 2010 21:42

[SciPy-user] [ANN] upfirdn 0.2.0


ANNOUNCEMENT 

I am pleased to announce a new release of "upfirdn" - version 0.2.0. This
package provides an efficient polyphase FIR resampler object (SWIG-ed C++)
and some python wrappers. 

This release greatly improves installation with distutils relative to the
initial 0.1.0 release. 0.2.0 includes no functional changes relative to
0.1.0. Also, the source code is now browse-able online through a Google Code
site with mercurial repository. 

  https://opensource.motorola.com/sf/projects/upfirdn  
  http://code.google.com/p/upfirdn/  

Thanks to Google for providing this hosting service!

--

-- 
View this message in context: http://old.nabble.com/-ANN--upfirdn-0.2.0-tp26996317p26996317.html
Sent from the Scipy-User mailing list archive at Nabble.com.
Pete Shepard | 3 Jan 2010 00:16
Picon

fisher's exact.py stalls?

Hello,

I am using "fishersexact.py" to compare two long ~10,000 lists of ratios. Each time I do this, the program get stuck? I can print the two ratios that come before the program stalls and if I give these numbers directly to the subroutine it seems to process them just fine. I am wondering if anyone has had a similar issue with  the "fishersexact.py" subroutine?

Thanks,


_______________________________________________
SciPy-User mailing list
SciPy-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
josef.pktd | 3 Jan 2010 00:42
Picon

Re: fisher's exact.py stalls?

On Sat, Jan 2, 2010 at 6:16 PM, Pete Shepard <peter.shepard <at> gmail.com> wrote:
> Hello,
>
> I am using "fishersexact.py" to compare two long ~10,000 lists of ratios.
> Each time I do this, the program get stuck? I can print the two ratios that
> come before the program stalls and if I give these numbers directly to the
> subroutine it seems to process them just fine. I am wondering if anyone has
> had a similar issue with  the "fishersexact.py" subroutine?

Do you mean fisherexact in the scipy trac ?

If yest, did you apply
http://projects.scipy.org/scipy/ticket/956#comment:10  by tkharris
which found and fixes one endless loop.

I was working on the ticket, but got stuck with some test failures
that I haven't figured out.

Do you know for which table the function gets stuck?

Josef

>
> Thanks,
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User <at> scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
Pete Shepard | 3 Jan 2010 01:10
Picon

Re: fisher's exact.py stalls?

That did the trick, thanks.

On Sat, Jan 2, 2010 at 3:42 PM, <josef.pktd <at> gmail.com> wrote:
On Sat, Jan 2, 2010 at 6:16 PM, Pete Shepard <peter.shepard <at> gmail.com> wrote:
> Hello,
>
> I am using "fishersexact.py" to compare two long ~10,000 lists of ratios.
> Each time I do this, the program get stuck? I can print the two ratios that
> come before the program stalls and if I give these numbers directly to the
> subroutine it seems to process them just fine. I am wondering if anyone has
> had a similar issue with  the "fishersexact.py" subroutine?

Do you mean fisherexact in the scipy trac ?

If yest, did you apply
http://projects.scipy.org/scipy/ticket/956#comment:10  by tkharris
which found and fixes one endless loop.

I was working on the ticket, but got stuck with some test failures
that I haven't figured out.

Do you know for which table the function gets stuck?

Josef


>
> Thanks,
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User <at> scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
_______________________________________________
SciPy-User mailing list
SciPy-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user

_______________________________________________
SciPy-User mailing list
SciPy-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
Tim Michelsen | 4 Jan 2010 18:11
Picon

scikits.timeseries.tsfromtxt & guess

Hello,
I first want to stress again that the tsfromtxt in the timeseries scikit is a
real killer function.
Once one has understood the easyness of the "dateconverter" function it becomes
a quick exercise to read in timeseries from ASCII files.

As I am currently predefining a set of dateconverters for frquently used
date-time combinations in different formats, I have the following question:
Is it possible to integrate "ts.extras.guess_freq(dates)" into the function
scikits.timeseries.tsfromtxt?

Currently, I would need to read a file twice: once for guessing the frequency
based on a created list of dates and then read file to create the timeseries.

Ideally, I would like to do:

def mydateconverter(year, month, day, hour):
    freq = ts.extras.guess_freq(year, month, day, hour)
    ts_date =  ts.Date(freq, year=int(year), month=int(month), day=int(day))

    return ts_date

myts= ts.tsfromtxt(datafile, skiprows=1, names=None, 
                      datecols=(1,2,3), guess_freq=True,  
                      dateconverter=mydateconverter)

Or is this already possible and I am just not getting this right?

How can I pass a frequency value to the dateconverter argument?

Like:
def mydateconverter(year, month, day, hour, freq='T'):
    freq = ts.extras.guess_freq(year, month, day, hour)
    ts_date =  ts.Date(freq, year=int(year), month=int(month), day=int(day))

    return ts_date

myts= ts.tsfromtxt(datafile, skiprows=1, names=None, 
                      datecols=(1,2,3), guess_freq=True,  
                      dateconverter=mydateconverter(freq='H'))

I get this error then:
TypeError: mydateconverter() takes at least 2 non-keyword arguments (0 given)

Thanks in advance for any hints,
Timmie
Tim Michelsen | 4 Jan 2010 18:19
Picon

How to concatenate timeseries

Hello,
I am reading timeseries data from different files covering various successive
time intervals.

What is the best methoth concatenate these to one long running time series?

I tried:

import scikits.timeseries as ts
series = ts.time_series([0,1,2,3], start_date=ts.Date(freq='A', year=2005))
series1 = ts.time_series([0,1,2,3], start_date=ts.Date(freq='A', year=2009))

import numpy as np
full = np.concatenate([series, series1])

But the full series has then the frequency 'U' for undefined.

What am I missing?

Thanks,
Timmie
Pierre GM | 4 Jan 2010 18:50
Picon

Re: How to concatenate timeseries

On Jan 4, 2010, at 12:19 PM, Tim Michelsen wrote:
> What is the best methoth concatenate these to one long running time series?
> 
> I tried:
> 
> 
> import scikits.timeseries as ts
> series = ts.time_series([0,1,2,3], start_date=ts.Date(freq='A', year=2005))
> series1 = ts.time_series([0,1,2,3], start_date=ts.Date(freq='A', year=2009))
> 
> import numpy as np
> full = np.concatenate([series, series1])
> 
> But the full series has then the frequency 'U' for undefined.
> 
> What am I missing?

Use the concatenate function that comes with scikits.timeseries
>>> ts.concatenate([series,series1])
timeseries([0 1 2 3 0 1 2 3],
   dates = [2005 ... 2012],
   freq  = A-DEC)

ts.concatenate tests whether the series have the same frequency, and optional parameters let you decide
what to do with duplicates.
Pierre GM | 4 Jan 2010 19:21
Picon

Re: scikits.timeseries.tsfromtxt & guess

On Jan 4, 2010, at 12:11 PM, Tim Michelsen wrote:
> Hello,
> I first want to stress again that the tsfromtxt in the timeseries scikit is a
> real killer function.

My, thanks a lot

> Once one has understood the easyness of the "dateconverter" function it becomes
> a quick exercise to read in timeseries from ASCII files.
> 
> As I am currently predefining a set of dateconverters for frquently used
> date-time combinations in different formats, I have the following question:
> Is it possible to integrate "ts.extras.guess_freq(dates)" into the function
> scikits.timeseries.tsfromtxt?

Probably, but I doubt it'll be very different from the current behavior. See, the dateconverter function
transforms a series of strings into a unique Date, independently for each row of the input. You can't guess
the frequency of an individual Date, you need several to compare their lags. That means that no matter
what, you'll have to reprocess the array. I'd prefer to leave this operation up to the user...

> Currently, I would need to read a file twice: once for guessing the frequency
> based on a created list of dates and then read file to create the timeseries.

I'd first create the time series from the input, then try to guess the frequency from the DateArray

> 
> How can I pass a frequency value to the dateconverter argument?
> 
> Like:
> def mydateconverter(year, month, day, hour, freq='T'):
>    freq = ts.extras.guess_freq(year, month, day, hour)
>    ts_date =  ts.Date(freq, year=int(year), month=int(month), day=int(day))
> 
>    return ts_date
> 
> myts= ts.tsfromtxt(datafile, skiprows=1, names=None, 
>                      datecols=(1,2,3), guess_freq=True,  
>                      dateconverter=mydateconverter(freq='H'))
> 
> I get this error then:
> TypeError: mydateconverter() takes at least 2 non-keyword arguments (0 given)

Please send a small example of datafile so that I can test wht goes wrong. If I have to guess: the line
`dateconverter=mydateconverter(freq='H')` forces a call to mydateconverter without any argument
(but for he frequency). Of course, that won't fly. 
What you want is to have `mydateconverter(freq='H')` callable. You should probably create a class that
takes a frequency as instantiation input and that has a __call__ method, something like:

class myconverter(object)
    def __init__(freq='D'):
        self.freq=freq
    def __call__(self, y,m,d,h):
        return ts.Date(self.freq, year=int(y),month=int(m),day=int(day),hour=int(h))

That way, myconverter(freq='T') becomes a valid function (you can call it).
Tim Michelsen | 4 Jan 2010 20:58
Picon

Re: How to concatenate timeseries

> Use the concatenate function that comes with scikits.timeseries
>>>> ts.concatenate([series,series1])
> timeseries([0 1 2 3 0 1 2 3], dates = [2005 ... 2012], freq  = A-DEC)
> 
> 
> ts.concatenate tests whether the series have the same frequency, and
> optional parameters let you decide what to do with duplicates.
Must have overlooked that.
But it isn't in the docs either:
http://pytseries.sourceforge.net/search.html?q=concatenate

Gmane