Skip to content

ERR: more helpful error message on invalid access with a timestamp-like #7211

Closed
@jreback

Description

@jreback

related #7209

Might be a nicer error message (gist of this)

Hey you are trying to access a single element on AXIS 1, you can do it with a slice if you want, or use .loc to access the frame by row

In [3]: df = DataFrame(1,index=pd.date_range('20130101',periods=5),columns=['value'])

In [4]: df['20130102']
KeyError: '20130102'

In [5]: df['20130102':]
Out[5]: 
            value
2013-01-02      1
2013-01-03      1
2013-01-04      1
2013-01-05      1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closing CandidateMay be closeable, needs more eyeballsDatetimeDatetime data dtypeError ReportingIncorrect or improved errors from pandasIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions