Skip to content

Issue passing a Timestamp to Series.between_time() #12680

Closed
@SimonFransen

Description

@SimonFransen

Hi,

I have an issue with passing pandas.Timestamp objects as arguments to pandas.Series.between_time(start, end).

It appears that pandas.tseries.index.DatetimeIndex.indexer_between_time() tries to convert start_time and end_time arguments as strings.

The following lines give a temporary fix:

if not isinstance(start_time, Timestamp):
        start_time = to_time(start_time)
if not isinstance(end_time, Timestamp):
        end_time = to_time(end_time)

Thanks,
Simon

Metadata

Metadata

Assignees

No one assigned

    Labels

    DatetimeDatetime data dtypeDuplicate ReportDuplicate issue or pull requestIndexingRelated to indexing on series/frames, not to indexes themselvesUsage Question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions