<div class="gmail_quote">On Fri, Oct 9, 2009 at 2:16 PM, Glen Zangirolami <span dir="ltr"><<a href="mailto:digitalman66@gmail.com">digitalman66@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
If i have a list of dates:<div>date_list = ['2008-12-29','2008-12-31','2008-01-01','2008-01-02','2008-01-03','2008-01-05']</div><div><br></div><div>How do I find the missing dates in the range of dates and insert them into the list so I get?</div>
<div>date_list = ['2008-12-29','2008-12-30','2008-12-31','2008-01-01','2008-01-02','2008-01-03','2008-12-04','2008-01-05']</div><div><br></div><div>Hopefully the case is that I haven't found the correct python module that does it ;)</div>
</blockquote><div><br></div><div>The datetime module exists... you could easily write a function that does something along the lines of:</div><div><br></div><div>def date_range(startdate, enddate):</div><div> #do something here to make a range of dates</div>
<div><br></div><div>though you may want to write a function that checks for a missing date first.</div><div><br></div><div>HTH,</div><div>Wayne</div></div>