Skip to content

PeriodIndex with float input inconsistency #13232

Closed
@sinhrks

Description

@sinhrks

Code Sample, a copy-pastable example if possible

pd.PeriodIndex([1.1], freq='M')
# ValueError: Given date string not likely a datetime.

pd.PeriodIndex(np.array([1.1]), freq='M')
# PeriodIndex(['1970-02'], dtype='int64', freq='M'

Expected Output

Consistently raise or coerce to Period

output of pd.show_versions()

0.18.1

CC: @MaximilianR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions