Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Pandas 1.3.0 DataFrame repr fails due to IndexError #218

@samgd

Description

@samgd

Pandas 1.3.0 passes an Ellipsis object to __getitem__ when the user prints it. This causes an IndexError to be thrown as __getitem__ does not, and is not specified to, support Ellipsis indexing.

Note that this only happens when the array is "large" so it must be interacting with printoptions somewhere.

It displays okay on Pandas 1.2.5 (error not thrown).

Example:

import fletcher as fr
import numpy as np
import pandas as pd
import pyarrow as pa


array = pa.array(np.arange(1000))

# ok
print(array)

# ok
fl_array = fr.FletcherContinuousArray(array)
print(fl_array)

# ok
ser = pd.Series(fl_array)
print(ser)

# fails, IndexError
df = pd.DataFrame({"foo": fl_array})
print(df)

Version information:

$ python --version
Python 3.8.0
$ for lib in fletcher numpy pandas pyarrow; do python -c "import $lib; print('$lib', $lib.__version__)"; done
fletcher 0.7.2
numpy 1.20.3
pandas 1.3.0
pyarrow 4.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions