Skip to content

Support pandas Float64Dtype in boxenplot #2434

@afrendeiro

Description

@afrendeiro

Pandas 1.2.0 added a Float64DType type extension. Seaborn boxenplot fails with that input:

data = pd.DataFrame(
   {"cont": np.random.random(20), "cat": np.random.choice(["a", "b"], 20)}
).convert_dtypes()

sns.boxplot(data=data, x='cat', y='cont')  #  okay
sns.boxenplot(data=data, x='cat', y='cont')  # error

At the same time Barplot and Boxplot don't fail. This is because boxenplot is at some point converting the input into a numpy array which makes the array dtype 'object'. That dtype fails when is input to np.isfinite here.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions