understanding dash
This commit is contained in:
+22
@@ -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,3 +2,4 @@ python-dotenv
|
||||
polars
|
||||
requests
|
||||
pyyaml
|
||||
dash
|
||||
Reference in New Issue
Block a user