[SciPy-User] find particular day_of_week
josef.pktd at gmail.com
josef.pktd at gmail.com
Wed Jan 27 16:25:45 EST 2010
On Wed, Jan 27, 2010 at 4:18 PM, Robert Ferrell <ferrell at diablotech.com> wrote:
> I have a time series, I want to operate (read only) on all the items
> with a particular day_of_week. What is an efficient way to get at
> those?
>
> I've tried:
>
> desiredDates = [dt for dt in myTS.dates if dt.day_of_week ==
> day_of_week]
>
> desiredSeries = myTS[desiredDates]
>
> but that seems quite slow. The second line is the one which is taking
> all the time. Is there a faster way? I don't need a copy, just a
> view, if that helps.
I think numpy-discussion jan 20th "dates, np.where finding months"
answers this.
Josef
>
> thanks,
> -robert
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
More information about the SciPy-User
mailing list