Convenience function for timeseries
from pydata mailing list:

just wondering if there is a more convenient way to convert the new Period /
PeriodIndex classes to datetime objects. As well as converting into lists of
tuples to insert into sql databases.

For example:

import pandas as pd

prng = pd.period_range('2012-01', periods = 12, freq = 'M')
prd = pd.Period.now('B')
ts = pd.Series(range(12), index = prng)

# could we have a shortcut to_pydatetime method on the Period class?
dt = prd.to_timestamp().to_pydatetime() # pandas 0.8 way
# desired: dt = prd.to_pydatetime()

# ditto for PeriodIndex
dtrng = prng.to_timestamp().to_pydatetime() # pandas 0.8 way
# desired: dtrng = prng.to_pydatetime()

# converting time series to list of (datetime, value) tuples for inserting into
# sql database. This is what .tolist() returned in the old scikits.timeseries
# module
sql_tuples = zip(ts.index.to_timestamp().to_pydatetime(), ts.tolist()) # pandas 0.8 way
# desired: sql_tuples = ts.tolist() # or ts.to_sqltuples(), etc
