Skip to content

DatetimeIndex from Series worked in 0.12.x? #6273

Closed
@jseabold

Description

@jseabold

I'm fairly certain this worked before a recent upgrade. Too busy to check right now. Maybe it shouldn't work and it's just been fixed, but ... I have something like this in a lot of places in my code.

df = pd.DataFrame(np.random.rand(5,3))
df['date'] = ['1-1-1990', '2-1-1990', '3-1-1990', '4-1-1990', '5-1-1990']
pd.DatetimeIndex(df['date'], freq='MS')

Raises about Series not having an attribute inferred_freq. Why is it trying to infer a frequency when I passed freq? Is it a new check?

[22]: pd.version.version
[22]: '0.13.0-472-g9109812'

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