diff --git "a/sandbox/talk_to_data/20250306 - CQA - Step_by_step_vanna.ipynb" "b/sandbox/talk_to_data/20250306 - CQA - Step_by_step_vanna.ipynb" --- "a/sandbox/talk_to_data/20250306 - CQA - Step_by_step_vanna.ipynb" +++ "b/sandbox/talk_to_data/20250306 - CQA - Step_by_step_vanna.ipynb" @@ -2,9 +2,18 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The autoreload extension is already loaded. To reload it, use:\n", + " %reload_ext autoreload\n" + ] + } + ], "source": [ "import sys\n", "import os\n", @@ -29,12 +38,12 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "from climateqa.engine.talk_to_data.myVanna import MyVanna\n", - "from climateqa.engine.talk_to_data.utils import loc2coords, detect_location_with_openai, detectTable, nearestNeighbourSQL, detect_relevant_tables, replace_coordonates\n", + "from climateqa.engine.talk_to_data.utils import loc2coords, detect_location_with_openai, detectTable, nearestNeighbourSQL, detect_relevant_tables, replace_coordonates#,nearestNeighbourPostgres\n", "\n", "from climateqa.engine.llm import get_llm" ] @@ -50,7 +59,15 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Loading embeddings model: BAAI/bge-base-en-v1.5\n" + ] + } + ], "source": [ "from dotenv import load_dotenv\n", "\n", @@ -63,10 +80,19 @@ "INDEX_NAME = os.getenv('VANNA_INDEX_NAME')\n", "VANNA_MODEL = os.getenv('VANNA_MODEL')\n", "\n", + "\n", + "DB_USER=os.getenv('SUPABASE_USER')\n", + "DB_PASSWORD=os.getenv('SUPABASE_PASSWORD')\n", + "DB_HOST = os.getenv('SUPABASE_HOST')\n", + "DB_PORT=os.getenv('SUPABASE_PORT')\n", + "DB_DBNAME=os.getenv('SUPABASE_DBNAME')\n", + "DB_DATABASE_URL = f\"postgresql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_DBNAME}\"\n", + "\n", "ROOT_PATH = os.path.dirname(os.path.dirname(os.getcwd()))\n", "\n", "#Vanna object\n", "vn = MyVanna(config = {\"temperature\": 0, \"api_key\": OPENAI_API_KEY, 'model': VANNA_MODEL, 'pc_api_key': PC_API_KEY, 'index_name': INDEX_NAME, \"top_k\" : 4})\n", + "\n", "db_vanna_path = ROOT_PATH + \"/data/drias/drias.db\"\n", "vn.connect_to_sqlite(db_vanna_path)\n" ] @@ -84,8 +110,8 @@ "metadata": {}, "outputs": [], "source": [ - "# query = \"Quelle sera la température à Marseille sur les prochaines années ?\"\n", - "query = \"Comment vont évoluer les températures à marseille ?\"" + "query = \"Quelle sera la température à Marseille sur les prochaines années ?\"\n", + "# query = \"Comment vont évoluer les températures à marseille ?\"" ] }, { @@ -97,9 +123,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Marseille\n" + ] + } + ], "source": [ "location = detect_location_with_openai(OPENAI_API_KEY, query)\n", "print(location)" @@ -114,9 +148,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 26, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "quelle sera la température à lat, long : (43.2961743, 5.3699525) sur le:s prochaines années ?\n" + ] + } + ], "source": [ "coords = loc2coords(location)\n", "user_input = query.lower().replace(location.lower(), f\"lat, long : {coords}\")\n", @@ -132,11 +174,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 28, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "quelle sera la température à lat, long : (43.166954040527344, 5.430534839630127) sur le:s prochaines années ?\n" + ] + } + ], "source": [ "relevant_tables = detect_relevant_tables(user_input, llm) \n", + "# coords_tables = [nearestNeighbourPostgres(DB_DATABASE_URL, coords, relevant_tables[i]) for i in range(len(relevant_tables))]\n", "coords_tables = [nearestNeighbourSQL(db_vanna_path, coords, relevant_tables[i]) for i in range(len(relevant_tables))]\n", "user_input_with_coords = replace_coordonates(coords, user_input, coords_tables)\n", "print(user_input_with_coords)" @@ -151,30 +202,1517 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "'quelle sera la température à lat, long : (43.166954040527344, 5.430534839630127) sur le:s prochaines années ?'" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "sql_query, result_dataframe, figure = vn.ask(user_input_with_coords, print_results=False, allow_llm_to_see_data=True, auto_train=False)\n" + "user_input_with_coords" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 33, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "SQL Prompt: [{'role': 'system', 'content': \"You are a SQLite expert. Please help to generate a SQL query to answer the question. Your response should ONLY be based on the given context and follow the response guidelines and format instructions. \\n===Tables \\nCREATE TABLE Mean_winter_temperature (\\n y FLOAT,\\n x FLOAT,\\n year INT, \\n month INT, \\n day INT \\n,\\n LambertParisII VARCHAR(255),\\n lat FLOAT,\\n lon FLOAT,\\n TMm FLOAT\\n);\\n\\nCREATE TABLE Mean_summer_temperature (\\n y FLOAT,\\n x FLOAT,\\n year INT, \\n month INT, \\n day INT \\n,\\n LambertParisII VARCHAR(255),\\n lat FLOAT,\\n lon FLOAT,\\n TMm FLOAT\\n);\\n\\nCREATE TABLE Maximum_summer_temperature (\\n y FLOAT,\\n x FLOAT,\\n year INT, \\n month INT, \\n day INT \\n,\\n LambertParisII VARCHAR(255),\\n lat FLOAT,\\n lon FLOAT,\\n TXm FLOAT\\n);\\n\\nCREATE TABLE Number_of_days_with_Tx_above_30C (\\n y FLOAT,\\n x FLOAT,\\n year INT, \\n month INT, \\n day INT \\n,\\n LambertParisII VARCHAR(255),\\n lat FLOAT,\\n lon FLOAT,\\n TX30D FLOAT\\n);\\n\\n\\n===Additional Context \\n\\nThe Number of days with Tx above 35C table contains information on the number of days when the maximum temperature in the past and the future\\nis greater than or equal to 35°C.\\nThe variables are as follows:\\n- 'y' and 'x': Lambert Paris II coordinates for the location.\\n- year: Year of the observation.\\n\\n - month : Month of the observation.\\n\\n - day: Day of the observation.\\n\\n- 'LambertParisII': Indicates that the x, y coordinates are in the Lambert Paris II projection.\\n- 'lat' and 'lon': Latitude and longitude of the location.\\n- 'TX35D': Number of days with Tx ≥ 35°C.\\n\\nThe Number of days with Tx above 30C table contains information on the number of days when the maximum temperature in the past and the future\\nis greater than or equal to 30°C.\\nThe variables are as follows:\\n- 'y' and 'x': Lambert Paris II coordinates for the location.\\n- year: Year of the observation.\\n\\n - month : Month of the observation.\\n\\n - day: Day of the observation.\\n\\n- 'LambertParisII': Indicates that the x, y coordinates are in the Lambert Paris II projection.\\n- 'lat' and 'lon': Latitude and longitude of the location.\\n- 'TX30D': Number of days with Tx ≥ 30°C.\\n\\nThe Mean winter temperature table contains information on the average (mean) winter temperature in the past and the future.\\nThe variables are as follows:\\n- 'y' and 'x': Lambert Paris II coordinates for the location.\\n- year: Year of the observation.\\n\\n - month : Month of the observation.\\n\\n - day: Day of the observation.\\n\\n- 'LambertParisII': Indicates that the x, y coordinates are in the Lambert Paris II projection.\\n- 'lat' and 'lon': Latitude and longitude of the location.\\n- 'TMm': Average winter temperature.\\n\\nThe Mean summer temperature table contains information on the average summer temperature in the past and the future.\\nThe variables are as follows:\\n- 'y' and 'x': Lambert Paris II coordinates for the location.\\n- year: Year of the observation.\\n\\n - month : Month of the observation.\\n\\n - day: Day of the observation.\\n\\n- 'LambertParisII': Indicates that the x and y coordinates are in Lambert Paris II projection.\\n- 'lat' and 'lon': Latitude and longitude of the location.\\n- 'TMm': Average summer temperature.\\n\\n===Response Guidelines \\n1. If the provided context is sufficient, please generate a valid SQL query without any explanations for the question. \\n2. If the provided context is almost sufficient but requires knowledge of a specific string in a particular column, please generate an intermediate SQL query to find the distinct strings in that column. Prepend the query with a comment saying intermediate_sql \\n3. If the provided context is insufficient, please give a sql query based on your knowledge and the context provided. \\n4. Please use the most relevant table(s). \\n5. If the question has been asked and answered before, please repeat the answer exactly as it was given before. \\n6. Ensure that the output SQL is SQLite-compliant and executable, and free of syntax errors. \\n7. Add a description of the table in the result of the sql query, if relevant. \\n8 Make sure to include the relevant KPI in the SQL query. The query should return impactfull data \\n\"}, {'role': 'user', 'content': 'quelle sera la température à lat, long : (43.166954040527344, 5.430534839630127) sur le:s prochaines années ?'}]\n", + "Using model gpt-4o-mini for 1082.0 tokens (approx)\n", + "LLM Response: ```sql\n", + "SELECT year, month, day, TMm AS Mean_Summer_Temperature\n", + "FROM Mean_summer_temperature\n", + "WHERE lat = 43.166954040527344 AND lon = 5.430534839630127\n", + "ORDER BY year, month, day;\n", + "```\n", + "LLM Response: ```sql\n", + "SELECT year, month, day, TMm AS Mean_Summer_Temperature\n", + "FROM Mean_summer_temperature\n", + "WHERE lat = 43.166954040527344 AND lon = 5.430534839630127\n", + "ORDER BY year, month, day;\n", + "```\n", + "Extracted SQL: SELECT year, month, day, TMm AS Mean_Summer_Temperature\n", + "FROM Mean_summer_temperature\n", + "WHERE lat = 43.166954040527344 AND lon = 5.430534839630127\n", + "ORDER BY year, month, day;\n", + "Using model gpt-4o-mini for 244.75 tokens (approx)\n", + " year month day Mean_Summer_Temperature date\n", + "0 2031 7 16 24.061035 2031-07-16\n", + "1 2031 7 16 24.061035 2031-07-16\n", + "2 2032 7 16 24.530693 2032-07-16\n", + "3 2032 7 16 24.530693 2032-07-16\n", + "4 2033 7 16 24.722235 2033-07-16\n" + ] + } + ], + "source": [ + "sql_query, result_dataframe, figure = vn.ask(user_input_with_coords, print_results=False, allow_llm_to_see_data=True, auto_train=False)\n", + "print(result_dataframe.head())" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
yearmonthdayMean_Summer_Temperaturedate
0203171624.0610352031-07-16
1203171624.0610352031-07-16
2203271624.5306932032-07-16
3203271624.5306932032-07-16
4203371624.7222352033-07-16
5203371624.7222352033-07-16
6203471623.8462922034-07-16
7203471623.8462922034-07-16
8203571624.2314222035-07-16
9203571624.2314222035-07-16
10203671624.4889422036-07-16
11203671624.4889422036-07-16
12203771624.7942412037-07-16
13203771624.7942412037-07-16
14203871624.7305542038-07-16
15203871624.7305542038-07-16
16203971624.4497992039-07-16
17203971624.4497992039-07-16
18204071624.4072692040-07-16
19204071624.4072692040-07-16
20204171624.7685482041-07-16
21204171624.7685482041-07-16
22204271624.5347962042-07-16
23204271624.5347962042-07-16
24204371624.7691812043-07-16
25204371624.7691812043-07-16
26204471624.4898772044-07-16
27204471624.4898772044-07-16
28204571624.4480762045-07-16
29204571624.4480762045-07-16
30204671625.1112822046-07-16
31204671625.1112822046-07-16
32204771624.7231382047-07-16
33204771624.7231382047-07-16
34204871625.1875772048-07-16
35204871625.1875772048-07-16
36204971624.8296542049-07-16
37204971624.8296542049-07-16
38205071625.0533942050-07-16
39205071625.0533942050-07-16
\n", + "
" + ], + "text/plain": [ + " year month day Mean_Summer_Temperature date\n", + "0 2031 7 16 24.061035 2031-07-16\n", + "1 2031 7 16 24.061035 2031-07-16\n", + "2 2032 7 16 24.530693 2032-07-16\n", + "3 2032 7 16 24.530693 2032-07-16\n", + "4 2033 7 16 24.722235 2033-07-16\n", + "5 2033 7 16 24.722235 2033-07-16\n", + "6 2034 7 16 23.846292 2034-07-16\n", + "7 2034 7 16 23.846292 2034-07-16\n", + "8 2035 7 16 24.231422 2035-07-16\n", + "9 2035 7 16 24.231422 2035-07-16\n", + "10 2036 7 16 24.488942 2036-07-16\n", + "11 2036 7 16 24.488942 2036-07-16\n", + "12 2037 7 16 24.794241 2037-07-16\n", + "13 2037 7 16 24.794241 2037-07-16\n", + "14 2038 7 16 24.730554 2038-07-16\n", + "15 2038 7 16 24.730554 2038-07-16\n", + "16 2039 7 16 24.449799 2039-07-16\n", + "17 2039 7 16 24.449799 2039-07-16\n", + "18 2040 7 16 24.407269 2040-07-16\n", + "19 2040 7 16 24.407269 2040-07-16\n", + "20 2041 7 16 24.768548 2041-07-16\n", + "21 2041 7 16 24.768548 2041-07-16\n", + "22 2042 7 16 24.534796 2042-07-16\n", + "23 2042 7 16 24.534796 2042-07-16\n", + "24 2043 7 16 24.769181 2043-07-16\n", + "25 2043 7 16 24.769181 2043-07-16\n", + "26 2044 7 16 24.489877 2044-07-16\n", + "27 2044 7 16 24.489877 2044-07-16\n", + "28 2045 7 16 24.448076 2045-07-16\n", + "29 2045 7 16 24.448076 2045-07-16\n", + "30 2046 7 16 25.111282 2046-07-16\n", + "31 2046 7 16 25.111282 2046-07-16\n", + "32 2047 7 16 24.723138 2047-07-16\n", + "33 2047 7 16 24.723138 2047-07-16\n", + "34 2048 7 16 25.187577 2048-07-16\n", + "35 2048 7 16 25.187577 2048-07-16\n", + "36 2049 7 16 24.829654 2049-07-16\n", + "37 2049 7 16 24.829654 2049-07-16\n", + "38 2050 7 16 25.053394 2050-07-16\n", + "39 2050 7 16 25.053394 2050-07-16" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "result_dataframe" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "hovertemplate": "date=%{x}
Mean_Summer_Temperature=%{y}", + "legendgroup": "", + "line": { + "color": "#636efa", + "dash": "solid" + }, + "marker": { + "symbol": "circle" + }, + "mode": "lines", + "name": "", + "orientation": "v", + "showlegend": false, + "type": "scatter", + "x": [ + "2031-07-16T00:00:00", + "2031-07-16T00:00:00", + "2032-07-16T00:00:00", + "2032-07-16T00:00:00", + "2033-07-16T00:00:00", + "2033-07-16T00:00:00", + "2034-07-16T00:00:00", + "2034-07-16T00:00:00", + "2035-07-16T00:00:00", + "2035-07-16T00:00:00", + "2036-07-16T00:00:00", + "2036-07-16T00:00:00", + "2037-07-16T00:00:00", + "2037-07-16T00:00:00", + "2038-07-16T00:00:00", + "2038-07-16T00:00:00", + "2039-07-16T00:00:00", + "2039-07-16T00:00:00", + "2040-07-16T00:00:00", + "2040-07-16T00:00:00", + "2041-07-16T00:00:00", + "2041-07-16T00:00:00", + "2042-07-16T00:00:00", + "2042-07-16T00:00:00", + "2043-07-16T00:00:00", + "2043-07-16T00:00:00", + "2044-07-16T00:00:00", + "2044-07-16T00:00:00", + "2045-07-16T00:00:00", + "2045-07-16T00:00:00", + "2046-07-16T00:00:00", + "2046-07-16T00:00:00", + "2047-07-16T00:00:00", + "2047-07-16T00:00:00", + "2048-07-16T00:00:00", + "2048-07-16T00:00:00", + "2049-07-16T00:00:00", + "2049-07-16T00:00:00", + "2050-07-16T00:00:00", + "2050-07-16T00:00:00" + ], + "xaxis": "x", + "y": [ + 24.061035294117687, + 24.061035294117687, + 24.530692941176483, + 24.530692941176483, + 24.722234705882386, + 24.722234705882386, + 23.84629176470588, + 23.84629176470588, + 24.231422352941195, + 24.231422352941195, + 24.488941764705885, + 24.488941764705885, + 24.79424117647062, + 24.79424117647062, + 24.730553529411793, + 24.730553529411793, + 24.44979882352942, + 24.44979882352942, + 24.40726882352942, + 24.40726882352942, + 24.768547647058824, + 24.768547647058824, + 24.53479647058822, + 24.53479647058822, + 24.769181176470624, + 24.769181176470624, + 24.489877058823538, + 24.489877058823538, + 24.448076470588262, + 24.448076470588262, + 25.111282352941203, + 25.111282352941203, + 24.72313823529413, + 24.72313823529413, + 25.187577058823535, + 25.187577058823535, + 24.829653529411814, + 24.829653529411814, + 25.053394117647144, + 25.053394117647144 + ], + "yaxis": "y" + } + ], + "layout": { + "legend": { + "tracegroupgap": 0 + }, + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#f2f5fa" + }, + "error_y": { + "color": "#f2f5fa" + }, + "marker": { + "line": { + "color": "rgb(17,17,17)", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "rgb(17,17,17)", + "width": 0.5 + }, + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#A2B1C6", + "gridcolor": "#506784", + "linecolor": "#506784", + "minorgridcolor": "#506784", + "startlinecolor": "#A2B1C6" + }, + "baxis": { + "endlinecolor": "#A2B1C6", + "gridcolor": "#506784", + "linecolor": "#506784", + "minorgridcolor": "#506784", + "startlinecolor": "#A2B1C6" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "pattern": { + "fillmode": "overlay", + "size": 10, + "solidity": 0.2 + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "pie": [ + { + "automargin": true, + "type": "pie" + } + ], + "scatter": [ + { + "marker": { + "line": { + "color": "#283442" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "line": { + "color": "#283442" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#506784" + }, + "line": { + "color": "rgb(17,17,17)" + } + }, + "header": { + "fill": { + "color": "#2a3f5f" + }, + "line": { + "color": "rgb(17,17,17)" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#f2f5fa", + "arrowhead": 0, + "arrowwidth": 1 + }, + "autotypenumbers": "strict", + "coloraxis": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#f2f5fa" + }, + "geo": { + "bgcolor": "rgb(17,17,17)", + "lakecolor": "rgb(17,17,17)", + "landcolor": "rgb(17,17,17)", + "showlakes": true, + "showland": true, + "subunitcolor": "#506784" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "dark" + }, + "paper_bgcolor": "rgb(17,17,17)", + "plot_bgcolor": "rgb(17,17,17)", + "polar": { + "angularaxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + }, + "bgcolor": "rgb(17,17,17)", + "radialaxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "rgb(17,17,17)", + "gridcolor": "#506784", + "gridwidth": 2, + "linecolor": "#506784", + "showbackground": true, + "ticks": "", + "zerolinecolor": "#C8D4E3" + }, + "yaxis": { + "backgroundcolor": "rgb(17,17,17)", + "gridcolor": "#506784", + "gridwidth": 2, + "linecolor": "#506784", + "showbackground": true, + "ticks": "", + "zerolinecolor": "#C8D4E3" + }, + "zaxis": { + "backgroundcolor": "rgb(17,17,17)", + "gridcolor": "#506784", + "gridwidth": 2, + "linecolor": "#506784", + "showbackground": true, + "ticks": "", + "zerolinecolor": "#C8D4E3" + } + }, + "shapedefaults": { + "line": { + "color": "#f2f5fa" + } + }, + "sliderdefaults": { + "bgcolor": "#C8D4E3", + "bordercolor": "rgb(17,17,17)", + "borderwidth": 1, + "tickwidth": 0 + }, + "ternary": { + "aaxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + }, + "baxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + }, + "bgcolor": "rgb(17,17,17)", + "caxis": { + "gridcolor": "#506784", + "linecolor": "#506784", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "updatemenudefaults": { + "bgcolor": "#506784", + "borderwidth": 0 + }, + "xaxis": { + "automargin": true, + "gridcolor": "#283442", + "linecolor": "#506784", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "#283442", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "#283442", + "linecolor": "#506784", + "ticks": "", + "title": { + "standoff": 15 + }, + "zerolinecolor": "#283442", + "zerolinewidth": 2 + } + } + }, + "title": { + "text": "Mean Summer Temperature Over the Years" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "title": { + "text": "date" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "title": { + "text": "Mean_Summer_Temperature" + } + } + } + }, + "text/html": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "figure" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {