Skip to content

Cannot Add Dates that are the 1st of a Month and on a Sunday to a DatetimeIndex #5348

Closed
@jeffshek

Description

@jeffshek

Running into a problem when I attempt to add the first date of a month that is a Sunday.

import datetime
from pandas.tseries.index import DatetimeIndex

d1 = datetime.date(2002, 9, 1)
d2 = datetime.date(2013, 10, 27)

d3 = datetime.date(2012, 9, 30)

i1 = DatetimeIndex([d1, d2])
i2 = DatetimeIndex([d3])

i1 + i2

ValueError: Could not evaluate WOM-1SUN

Returns a ValueError "Could not evaluate WOM-1SUN". However, if I change d1 and then follow the same steps

d1 = datetime.date(2002, 9, 2)
i1 = DatetimeIndex([d1, d2])
i1 + i2

Out[2]: <class 'pandas.tseries.index.DatetimeIndex'>
[2002-09-02 00:00:00, ..., 2013-10-27 00:00:00]
Length: 3, Freq: None, Timezone: None

This create a DatetimeIndex adding the the index i1 and i2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions