Skip to content

to_plotly_json does not handle np.array properly #4281

Closed
@ChiQiao

Description

@ChiQiao

Code to reproduce the issue:

import json
import plotly.graph_objects as go
import numpy as np

fig = go.Figure(go.Scatter(x=np.array([0, 1]), y=np.array([0, 1])))
json.dumps(fig.to_plotly_json())  # TypeError: Object of type ndarray is not JSON serializable

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