enable creating a `dash.data_table.from_dataframe` helper function
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
Something like this:
table = dash_table.DataTable(
id='table',
columns=[{"name": i, "id": i} for i in df.columns],
data=df.to_dict('records'),
)
is a lot of cognitive overload - ppl need to think about list comprehension, dictionary in lists (i.e. records), methods of pandas likedf.to_dict, etc. It would be nice if we could just do this:
table = dash_table.from_dataframe(df, id="table")
Obviously we'd still need to think of columns and data inside the callback, but for the purpose of just displaying something inside the layout it's more concise.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing DataTable implementation and its handling of columns and data. Define the dataframe helper around the shown dash_table.from_dataframe(df, id="table") usage, and verify that it produces the equivalent table for displaying a pandas dataframe in a layout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100