Title: Create more table in one page · Issue #95 · plotly/dash-table-experiments · GitHub
Open Graph Title: Create more table in one page · Issue #95 · plotly/dash-table-experiments
X Title: Create more table in one page · Issue #95 · plotly/dash-table-experiments
Description: Hey guys, i would like to show 2 dataframe table, one is the dataset and the other one is statistical calculation of the dataframe (pandas describe()) of the dataframe. but I couldn't manage to show it. here is my code: # Define App Layo...
Open Graph Description: Hey guys, i would like to show 2 dataframe table, one is the dataset and the other one is statistical calculation of the dataframe (pandas describe()) of the dataframe. but I couldn't manage to sho...
X Description: Hey guys, i would like to show 2 dataframe table, one is the dataset and the other one is statistical calculation of the dataframe (pandas describe()) of the dataframe. but I couldn't manage to...
Opengraph URL: https://github.com/plotly/dash-table-experiments/issues/95
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Create more table in one page","articleBody":"Hey guys, i would like to show 2 dataframe table, one is the dataset and the other one is statistical calculation of the dataframe (pandas describe()) of the dataframe. but I couldn't manage to show it. here is my code: \r\n\r\n```\r\n# Define App Layout\r\napp.layout = html.Div([\r\n # Title\r\n html.H2('Analytics Dashboard'),\r\n \r\n # Dropdown to choose the dataset\r\n html.Div([\r\n html.Label('Choose Your Data'),\r\n dcc.Dropdown(\r\n options = [{'label':i, 'value':i} for i in onlyfiles], \r\n value = \" \",\r\n id=\"field-dropdown\"\r\n ), \r\n ], \r\n style = {'width':'25%', 'display':'inline-block'}\r\n ),\r\n\r\n # Visualize Dataframe using Dash's Data Table Experiments\r\n dt.DataTable(\r\n # initialize rows\r\n rows = [{}],\r\n # selection feature in dash table\r\n row_selectable = True,\r\n # filter feature in dash table\r\n filterable = True,\r\n # sort feature in dash table\r\n sortable = True,\r\n # initialize row selection array\r\n selected_row_indices = [],\r\n # data table id (for referencing)\r\n id = 'datatable'\r\n ), \r\n\r\n dt.DataTable(\r\n rows = [{}],\r\n row_selectable = False,\r\n filterable = False,\r\n sortable = False,\r\n id = 'statisticalTable'\r\n ), \r\n\r\n # Hidden div inside the app that stores the intermediate value\r\n # Use for sharing data between callback\r\n html.Div(id='intermediate-value', style={'display':'none'})\r\n])\r\n\r\n# Callback to read state change in dropdown\r\n@app.callback(Output('intermediate-value','children'),[Input('field-dropdown', 'value')])\r\ndef updateTable(field_dropdown): # update function in dropdown change\r\n # pandas dataframe construct\r\n df = pd.read_csv(datapath+field_dropdown)\r\n return df.to_json(date_format='iso', orient='split')\r\n\r\n@app.callback(Output('datatable','rows'),[Input('intermediate-value', 'children')])\r\ndef updateTable(jsonified_clean_data):\r\n print('update 1st table')\r\n dff = pd.read_json(jsonified_clean_data, orient='split')\r\n return dff.to_dict('record')\r\n\r\n@app.callback(Output('statisticalTable','rows'),[Input('intermediate-value', 'children')])\r\ndef updateStatTable(jsonified_clean_data):\r\n print('update 2nd table')\r\n dff = pd.read_json(jsonified_clean_data, orient='split')\r\n stat = dff.describe()\r\n print(stat)\r\n return stat.to_dict('record')\r\n\r\n\r\n# server main \r\nif __name__ == '__main__':\r\n app.run_server(debug=True)\r\n```","author":{"url":"https://github.com/elianalien","@type":"Person","name":"elianalien"},"datePublished":"2018-10-22T11:00:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/95/dash-table-experiments/issues/95"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:09d1cf50-b7aa-5243-96ef-334cc610e9a2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F9E:2F3AB6:2D026D6:3AE1C9B:6A5CD278 |
| html-safe-nonce | a0c13b90eb68e5566bbbf76cd7911306c4979a582eae906785e991cc042daeaf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjlFOjJGM0FCNjoyRDAyNkQ2OjNBRTFDOUI6NkE1Q0QyNzgiLCJ2aXNpdG9yX2lkIjoiMTUwMjgzNDM5MDM3MTk3OTg5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7341e2440270c8d75981827985805a990f302a8234a0b98d6360ffebca369800 |
| hovercard-subject-tag | issue:372475922 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/dash-table-experiments/95/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4156308350c82b83e2b17cb2ccde55450b6bd6b08e26b636c9333bffa4856855/plotly/dash-table-experiments/issues/95 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4156308350c82b83e2b17cb2ccde55450b6bd6b08e26b636c9333bffa4856855/plotly/dash-table-experiments/issues/95 |
| og:image:alt | Hey guys, i would like to show 2 dataframe table, one is the dataset and the other one is statistical calculation of the dataframe (pandas describe()) of the dataframe. but I couldn't manage to sho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | elianalien |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/dash-table-experiments git https://github.com/plotly/dash-table-experiments.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 99643060 |
| octolytics-dimension-repository_nwo | plotly/dash-table-experiments |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 99643060 |
| octolytics-dimension-repository_network_root_nwo | plotly/dash-table-experiments |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width