Skip to content

'infer_freq' can return timerule (WOM-5MON) that 'to_offset' does not support #9425

Closed
@craustin

Description

@craustin
import pandas as pd
index = [pd.Timestamp('2014-03-31 00:00:00'),
         pd.Timestamp('2014-06-30 00:00:00'),
         pd.Timestamp('2015-03-30 00:00:00'),
         pd.Timestamp('2015-06-29 00:00:00')]
freq = pd.infer_freq(index)  # WOM-5MON
pd.datetools.to_offset(freq)  # ValueError: Could not evaluate WOM-5MON

Instead of supporting WOM-5###, I think we can easily modify _get_wom_rule() to return None for this set of dates so it doesn't get inferred. Agree?

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