understanding dash

This commit is contained in:
Jake Pullen
2024-08-10 21:47:08 +01:00
parent f06ce9999f
commit 3504641643
2 changed files with 24 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
# Import packages
from dash import Dash, html, dash_table
import polars as pd
# Incorporate data
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminder2007.csv')
# Convert DataFrame to list of dictionaries
data = df.to_pandas().to_dict('records')
# Initialize the app
app = Dash()
# App layout
app.layout = [
html.Div(children='My First App with Data'),
dash_table.DataTable(data=data)
]
# Run the app
if __name__ == '__main__':
app.run(debug=True)
+2 -1
View File
@@ -1,4 +1,5 @@
python-dotenv python-dotenv
polars polars
requests requests
pyyaml pyyaml
dash