Skip to content

Plotly Express cannot process wide-form data with columns of different type. #4266

Closed

Description

@subsurfaceiodev

Hi! When running the following code:

df = pd.DataFrame({'numeric': [1, 2], 'string': ['A', 'B']})
fig = px.scatter(df, x=df.columns, facet_col='variable')
fig.show()

We get the following error:
ValueError: Plotly Express cannot process wide-form data with columns of different type.

Expected output is:
image

We understand the need for prevention of data type mixing for other type of plots, but for scatter or line plots use cases like expected output can be very common. Commenting the following code:

elif dtype != v_dtype:
    raise ValueError(
        "Plotly Express cannot process wide-form data with columns of different type."
    )

In plotly/express/_core.py gives us expected output.

Activity

  1. gvwilson commented on Jul 11, 2024

    @gvwilson
    Contributor

    Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions