to_timestamp method ignores how argument

29 views
Skip to first unread message

Dave Hirschfeld

unread,
Jul 31, 2012, 11:32:57 AM7/31/12
to PyData

In [131]: pd.__version__
Out[131]: '0.8.1'

In [133]: months = pd.period_range('01-Aug-2012', periods=14,
freq='M')

In [134]: months [0]
Out[134]: Period('Aug-2012', 'M')

In [135]: periods.to_timestamp(how='start')[0]
Out[135]: <Timestamp: 2012-08-31 00:00:00> <======= ??????

In[136]: periods.to_timestamp(freq='D', how='start')[0]
Out[136]: <Timestamp: 2012-08-01 00:00:00>

In [137]: periods.to_timestamp(freq='D', how='start')[0].freq
Out[137]: <1 MonthBegin> <======== ?????????????????????

On the first ??? line I think the result should be 2012-08-01
On the second ??? line I assumed the frequency would be daily

Are these bugs or is my understanding incorrect?

Regards,
Dave

Dave Hirschfeld

unread,
Aug 14, 2012, 7:00:02 AM8/14/12
to PyData
Opened as issue #1764 so that it doesn't get lost.

https://github.com/pydata/pandas/issues/1764

-Dave
Reply all
Reply to author
Forward
0 new messages