Skip to content

Commit

Permalink
add vizro-ai examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna-Xiong committed Oct 31, 2023
1 parent dfd8902 commit 1e54979
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
99 changes: 99 additions & 0 deletions vizro-ai/examples/example.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"from vizro_ai import VizroAI\n",
"vizro_ai = VizroAI()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from dotenv import load_dotenv\n",
"load_dotenv()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import plotly.express as px\n",
"df = px.data.gapminder()\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"vizro_ai.plot(df, \"the trend of gdp over years in the US\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"vizro_ai.plot(df, \"describe the composition of gdp in continent, and add horizontal line for avg gdp\", explain=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"vizro_ai.plot(df, \"show me the geo distribution of life expectancy\", explain=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.16"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
7 changes: 7 additions & 0 deletions vizro-ai/examples/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""AI plot example."""
import plotly.express as px
from vizro_ai import VizroAI

vizro_ai = VizroAI()
df = px.data.gapminder()
vizro_ai.plot(df, "describe the composition of gdp in continent,and horizontal line for avg gdp")

0 comments on commit 1e54979

Please sign in to comment.