[CentralOH] Python Puzzle: Day generator: Merged

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Thu Feb 5 09:19:30 CET 2015


On Thu, 5 Feb 2015 02:06:01 -0500, jep200404 at columbus.rr.com wrote:

> On Wed, 4 Feb 2015 20:55:14 -0500, Eric Floehr <eric at intellovations.com> wrote:
> 
> > Here is a group puzzle. I am interested in everyone's solutions.
> 
> > ... I need to iterate through days.
> > So I thought to make a function that works like range() only with dates.
> 
> See http://colug.net/python/cohpy/20150205/
> for what I did before looking at your code.

> > And my solution (open to refactoring):
> > https://gist.github.com/efloehr/3e1dd639f3c5c1b064b7

New code merges Eric's and my ideas.

    http://nbviewer.ipython.org/url/colug.net/python/cohpy/20150205/cohpy-20150205-day-generator-20150205-0255.ipynb
    http://colug.net/python/cohpy/20150205/cohpy-20150205-day-generator-20150205-0255.ipynb

> I like day= in timedelta(day=1) in your code. It documents the value.
> Likewise for days= at the bottom.

Was day= (instead of days=) a bug? 

What else did I miss?


More information about the CentralOH mailing list