Skip to content

tail throws exception on empty frame #5846

Closed
@MichaelWS

Description

@MichaelWS

currently, tail throws an exception on an empty frame but head does not.

import pandas as pd
df = pd.DataFrame()
df.tail()

traceback:
https://gist.github.com/MichaelWS/8256143

Should this be fixed by returning the frame if empty on calls to iloc?

We can check for empty in tail on length as well or create a new slice with start being None)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions