Skip to content

Plotly example on docs page raises NotImplementedError #8391

@anjiro

Description

@anjiro

Documentation is

  • Missing
  • Outdated
  • Confusing
  • Not sure?

Explain in Detail

Visit https://docs.marimo.io/guides/working_with_data/plotting/#plotly . The embedded notebook runs itself then errors out with

Traceback (most recent call last):
  File "/lib/python3.12/site-packages/plotly/express/_core.py", line 1204, in to_named_series
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/lib/python3.12/site-packages/marimo/_runtime/executor.py", line 138, in execute_cell
    exec(cell.body, glbls)
  File "/tmp/marimo_42/__marimo__cell_vblA_.py", line 2, in <module>
    px.scatter(x=[0, 1, 4, 9, 16], y=[0, 1, 2, 3, 4], width=600, height=300)
  File "/lib/python3.12/site-packages/plotly/express/_chart_types.py", line 69, in scatter
    return make_figure(args=locals(), constructor=go.Scatter)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/plotly/express/_core.py", line 2511, in make_figure
    args = build_dataframe(args, constructor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/plotly/express/_core.py", line 1757, in build_dataframe
    df_output, wide_id_vars = process_args_into_dataframe(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/plotly/express/_core.py", line 1410, in process_args_into_dataframe
    df_output[str(col_name)] = to_named_series(
                               ^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/plotly/express/_core.py", line 1209, in to_named_series
    raise NotImplementedError(msg)
NotImplementedError: Pandas installation is required if no dataframe is provided.

Your Suggestion for Changes

Add import pandas as pd to the first cell.

Will you submit a PR?

  • Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions