[SciPy-user] Converting arrays to dates for plot_date()

John Hunter jdh2358@gmail....
Thu May 1 15:49:49 CDT 2008


On Thu, May 1, 2008 at 3:15 PM, Dharhas Pothina
<Dharhas.Pothina@twdb.state.tx.us> wrote:

>  to generate the list of dates for plot_date()
>
>  but I can't work out how to convert
>
>  year = array([2006.0,2007.0])
>  month = array([11,12])
>  day = array([1,2])

dates = [datetime.date(y,m,d) for y,m,d in zip(year, month, day)]
plot(dates, data)  # requires 0.91.2 or svn -- else use date2num and plot_date

JDH


More information about the SciPy-user mailing list