Skip to content

Commit

Permalink
test chart example
Browse files Browse the repository at this point in the history
  • Loading branch information
lingyielia committed Aug 6, 2024
1 parent b445dee commit 457bbdc
Showing 1 changed file with 184 additions and 0 deletions.
184 changes: 184 additions & 0 deletions vizro-ai/examples/colab-example-chart.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "b72a43eb-2991-45da-844a-a88c1b9b6f1e",
"metadata": {},
"source": [
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mckinsey/vizro/blob/docs/add_colab_link/vizro-ai/examples/colab-example-chart.ipynb)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d6a12271-d8da-4013-a677-74c01605ccc1",
"metadata": {},
"outputs": [],
"source": [
"from google.colab import userdata\n",
"\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get(\"OPENAI_API_KEY\")\n",
"os.environ[\"OPENAI_BASE_URL\"] = userdata.get(\"OPENAI_BASE_URL\") # optional"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a79a438f-6998-468e-9707-998406c63652",
"metadata": {},
"outputs": [],
"source": [
"!pip install vizro-ai"
]
},
{
"cell_type": "markdown",
"id": "23acc66a-f782-46b8-832f-4ce5699f23e7",
"metadata": {},
"source": [
"# Getting started"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4f37b7d5-5073-4c06-9fe9-fda5ed38115a",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import vizro.plotly.express as px\n",
"\n",
"from vizro_ai import VizroAI"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "01af08c5-484e-4173-bb38-50fed9b7a764",
"metadata": {},
"outputs": [],
"source": [
"vizro_ai = VizroAI()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c6ac1b7d-5830-495b-94be-1ad7bf3022d3",
"metadata": {},
"outputs": [],
"source": [
"# data for plotting\n",
"df = px.data.gapminder()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c1a9db39-febf-4c09-af2c-168287f6e69f",
"metadata": {},
"outputs": [],
"source": [
"vizro_ai.plot(df, \"describe the composition of gdp in continent\")"
]
},
{
"cell_type": "markdown",
"id": "ccbacc74-d5fc-46b6-beb2-231242b0e601",
"metadata": {},
"source": [
"# Use a different model"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0aab1319-e11a-4354-a220-b6517a5934c3",
"metadata": {},
"outputs": [],
"source": [
"vizro_ai = VizroAI(model=\"gpt-4o\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1e0a171d-502b-4bf1-a0ae-93443af21274",
"metadata": {},
"outputs": [],
"source": [
"vizro_ai.plot(df, \"describe the composition of gdp in continent\")"
]
},
{
"cell_type": "markdown",
"id": "d4fda13e-a27f-4977-aa58-fcdd8b4cbc05",
"metadata": {},
"source": [
"# Use your own data"
]
},
{
"cell_type": "markdown",
"id": "dbedf477-cefe-49fa-b675-ef661425c3d3",
"metadata": {},
"source": [
"## Upload from local"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "dfd45d6e-e828-4f20-9afc-8a659a79b5d6",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "b4d83236-f584-4467-bcd3-30174d368e9d",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "d61aa049-6785-4926-a543-bfa3cb68e65a",
"metadata": {},
"source": [
"## Mount from Google Drive"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "25f17884-333a-4584-a469-3d859bffdd53",
"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.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit 457bbdc

Please sign in to comment.