plotly / plotly/plotly.py

Example "Update Button" is broken in: Python > Custom Controls > Custom Buttons

Open
#3,068 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

The code in the example doesn't correctly import the dataset, namely the Data column that is supposed to be index is imported as ordinary column making the following code disfunction in several places.

The fix is to put the line df = df.set_index('Date') just after reading the dataframe:

...
df = pd.read_csv(
    "https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv")
df = df.set_index('Date')
...

Cheers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Python > Custom Controls > Custom Buttons example and inspect the dataframe-loading code around pd.read_csv. Verify that the Date column is used as the dataframe index, then run the example and confirm the Update Button works in the affected places.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
documentation
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.