Skip to content

docs: add pandas to the README Quickstart Plotly Express install command - #5859

Closed
DawnofGenX wants to merge 1 commit into
plotly:mainfrom
DawnofGenX:express-quickstart-needs-pandas
Closed

DawnofGenX wants to merge 1 commit into
plotly:mainfrom
DawnofGenX:express-quickstart-needs-pandas

Conversation

@DawnofGenX

Copy link
Copy Markdown

Following up on #5857. #5804 split the Quickstart into Graph Objects and Plotly Express sections — thank you for that. The Express example still doesn't run in a fresh environment, though: plotly[express] only adds numpy, and the px.bar(x=[...], y=[...]) example uses list inputs, which Plotly Express needs pandas for.

Repro on current main, clean venv:

$ pip install plotly[express]
$ python -c "import plotly.express as px; px.bar(x=['a','b','c'], y=[1,3,2])"
NotImplementedError: Pandas installation is required if no dataframe is provided.

This adds pandas to the Express install line so the example runs as written:

$ pip install plotly[express] pandas
$ python -c "import plotly.express as px; px.bar(x=['a','b','c'], y=[1,3,2])"
# -> Figure with 1 trace

The Graph Objects section is unchanged and still works with just plotly.

The Plotly Express quickstart example (px.bar with list inputs) requires
pandas, but the install command only listed plotly[express], which does not
pull in pandas. A fresh environment following the quickstart fails with
'NotImplementedError: Pandas installation is required if no dataframe is
provided.' Add pandas to the install line so the example runs as written.
@camdecoster

Copy link
Copy Markdown
Contributor

As I said in #5857, the README has been updated to where we want it, so we don't need these changes. The line below the px example mentions that a dataframe library is required.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants