Skip to content

BUG: TimeStamp looses frequency info on arithmetic ops #4547

Closed
@mvds314

Description

@mvds314

Running the follow code generates an error using pandas 0.11 (with winpython 2.7.5.2 64 bit):
import pandas as pd
ts1=pd.date_range('1/1/2000',periods=1,freq='Q')[0]
ts1-1-1

Error:
Traceback (most recent call last):
File "", line 1, in
File "tslib.pyx", line 566, in pandas.tslib._Timestamp.sub (pandas\tslib.c:10775)
File "tslib.pyx", line 550, in pandas.tslib._Timestamp.add (pandas\tslib.c:10477)
ValueError: Cannot add integral value to Timestamp without offset.

Reason:
ts1.freq has value:
1 QuarterEnd: startingMonth=12, kwds={'startingMonth': 12}, offset=3 MonthEnds
but
(ts1-1).freq has no value

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions