Skip to content

plotly.express.bar does not work with pandas uint32 dtype when passing in a list of values for y #4344

Description

@coradek

plotly.express.bar does not display properly when using pandas "uint32" dtype and passing a list for y


temp = pd.DataFrame({"my_category":list("ABCD"),"feature_1":[10, 20, 40, 30],"feature_2":[60, 40, 50, 20]})

for col in temp.columns:
    if temp[col].dtype == "int64":
        temp[col] = temp[col].astype("uint32")

px.bar(
    data_frame = temp,
    x = "my_category",
    y = ["feature_1","feature_2"],
)

Screenshot 2023-08-29 at 11 58 07 AM

using the "int64" dtype or plotting a single y works correctly

Screenshot 2023-08-29 at 11 58 31 AM Screenshot 2023-08-29 at 11 59 01 AM

This last image is the expected behavior

plotly.version = 5.16.1
pandas.version = 2.0.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions