{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "application/javascript": "(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n var py_version = '3.1.1'.replace('rc', '-rc.').replace('.dev', '-dev.');\n var is_dev = py_version.indexOf(\"+\") !== -1 || py_version.indexOf(\"-\") !== -1;\n var reloading = false;\n var Bokeh = root.Bokeh;\n var bokeh_loaded = Bokeh != null && (Bokeh.version === py_version || (Bokeh.versions !== undefined && Bokeh.versions.has(py_version)));\n\n if (typeof (root._bokeh_timeout) === \"undefined\" || force) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks;\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, js_modules, js_exports, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n if (js_modules == null) js_modules = [];\n if (js_exports == null) js_exports = {};\n\n root._bokeh_onload_callbacks.push(callback);\n\n if (root._bokeh_is_loading > 0) {\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls.length === 0 && js_modules.length === 0 && Object.keys(js_exports).length === 0) {\n run_callbacks();\n return null;\n }\n if (!reloading) {\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n }\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n window._bokeh_on_load = on_load\n\n function on_error() {\n console.error(\"failed to load \" + url);\n }\n\n var skip = [];\n if (window.requirejs) {\n window.requirejs.config({'packages': {}, 'paths': {'jspanel': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/jspanel', 'jspanel-modal': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/modal/jspanel.modal', 'jspanel-tooltip': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/tooltip/jspanel.tooltip', 'jspanel-hint': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/hint/jspanel.hint', 'jspanel-layout': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/layout/jspanel.layout', 'jspanel-contextmenu': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/contextmenu/jspanel.contextmenu', 'jspanel-dock': 'https://cdn.jsdelivr.net/npm/jspanel4@4.12.0/dist/extensions/dock/jspanel.dock', 'gridstack': 'https://cdn.jsdelivr.net/npm/gridstack@7.2.3/dist/gridstack-all', 'notyf': 'https://cdn.jsdelivr.net/npm/notyf@3/notyf.min'}, 'shim': {'jspanel': {'exports': 'jsPanel'}, 'gridstack': {'exports': 'GridStack'}}});\n require([\"jspanel\"], function(jsPanel) {\n\twindow.jsPanel = jsPanel\n\ton_load()\n })\n require([\"jspanel-modal\"], function() {\n\ton_load()\n })\n require([\"jspanel-tooltip\"], function() {\n\ton_load()\n })\n require([\"jspanel-hint\"], function() {\n\ton_load()\n })\n require([\"jspanel-layout\"], function() {\n\ton_load()\n })\n require([\"jspanel-contextmenu\"], function() {\n\ton_load()\n })\n require([\"jspanel-dock\"], function() {\n\ton_load()\n })\n require([\"gridstack\"], function(GridStack) {\n\twindow.GridStack = GridStack\n\ton_load()\n })\n require([\"notyf\"], function() {\n\ton_load()\n })\n root._bokeh_is_loading = css_urls.length + 9;\n } else {\n root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length + Object.keys(js_exports).length;\n }\n\n var existing_stylesheets = []\n var links = document.getElementsByTagName('link')\n for (var i = 0; i < links.length; i++) {\n var link = links[i]\n if (link.href != null) {\n\texisting_stylesheets.push(link.href)\n }\n }\n for (var i = 0; i < css_urls.length; i++) {\n var url = css_urls[i];\n if (existing_stylesheets.indexOf(url) !== -1) {\n\ton_load()\n\tcontinue;\n }\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error;\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n } if (((window['jsPanel'] !== undefined) && (!(window['jsPanel'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/1.1.1/dist/bundled/floatpanel/jspanel4@4.12.0/dist/jspanel.js', 'https://cdn.holoviz.org/panel/1.1.1/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/modal/jspanel.modal.js', 'https://cdn.holoviz.org/panel/1.1.1/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/tooltip/jspanel.tooltip.js', 'https://cdn.holoviz.org/panel/1.1.1/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/hint/jspanel.hint.js', 'https://cdn.holoviz.org/panel/1.1.1/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/layout/jspanel.layout.js', 'https://cdn.holoviz.org/panel/1.1.1/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/contextmenu/jspanel.contextmenu.js', 'https://cdn.holoviz.org/panel/1.1.1/dist/bundled/floatpanel/jspanel4@4.12.0/dist/extensions/dock/jspanel.dock.js'];\n for (var i = 0; i < urls.length; i++) {\n skip.push(urls[i])\n }\n } if (((window['GridStack'] !== undefined) && (!(window['GridStack'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/1.1.1/dist/bundled/gridstack/gridstack@7.2.3/dist/gridstack-all.js'];\n for (var i = 0; i < urls.length; i++) {\n skip.push(urls[i])\n }\n } if (((window['Notyf'] !== undefined) && (!(window['Notyf'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/1.1.1/dist/bundled/notificationarea/notyf@3/notyf.min.js'];\n for (var i = 0; i < urls.length; i++) {\n skip.push(urls[i])\n }\n } var existing_scripts = []\n var scripts = document.getElementsByTagName('script')\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i]\n if (script.src != null) {\n\texisting_scripts.push(script.src)\n }\n }\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n if (skip.indexOf(url) !== -1 || existing_scripts.indexOf(url) !== -1) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n for (var i = 0; i < js_modules.length; i++) {\n var url = js_modules[i];\n if (skip.indexOf(url) !== -1 || existing_scripts.indexOf(url) !== -1) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n for (const name in js_exports) {\n var url = js_exports[name];\n if (skip.indexOf(url) >= 0 || root[name] != null) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onerror = on_error;\n element.async = false;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n element.textContent = `\n import ${name} from \"${url}\"\n window.${name} = ${name}\n window._bokeh_on_load()\n `\n document.head.appendChild(element);\n }\n if (!js_urls.length && !js_modules.length) {\n on_load()\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-3.1.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.1.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.1.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.1.1.min.js\", \"https://cdn.holoviz.org/panel/1.1.1/dist/panel.min.js\"];\n var js_modules = [];\n var js_exports = {};\n var css_urls = [];\n var inline_js = [ function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\nfunction(Bokeh) {} // ensure no trailing comma for IE\n ];\n\n function run_inline_js() {\n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n // Cache old bokeh versions\n if (Bokeh != undefined && !reloading) {\n\tvar NewBokeh = root.Bokeh;\n\tif (Bokeh.versions === undefined) {\n\t Bokeh.versions = new Map();\n\t}\n\tif (NewBokeh.version !== Bokeh.version) {\n\t Bokeh.versions.set(NewBokeh.version, NewBokeh)\n\t}\n\troot.Bokeh = Bokeh;\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n }\n root._bokeh_is_initializing = false\n }\n\n function load_or_wait() {\n // Implement a backoff loop that tries to ensure we do not load multiple\n // versions of Bokeh and its dependencies at the same time.\n // In recent versions we use the root._bokeh_is_initializing flag\n // to determine whether there is an ongoing attempt to initialize\n // bokeh, however for backward compatibility we also try to ensure\n // that we do not start loading a newer (Panel>=1.0 and Bokeh>3) version\n // before older versions are fully initialized.\n if (root._bokeh_is_initializing && Date.now() > root._bokeh_timeout) {\n root._bokeh_is_initializing = false;\n root._bokeh_onload_callbacks = undefined;\n console.log(\"Bokeh: BokehJS was loaded multiple times but one version failed to initialize.\");\n load_or_wait();\n } else if (root._bokeh_is_initializing || (typeof root._bokeh_is_initializing === \"undefined\" && root._bokeh_onload_callbacks !== undefined)) {\n setTimeout(load_or_wait, 100);\n } else {\n Bokeh = root.Bokeh;\n bokeh_loaded = Bokeh != null && (Bokeh.version === py_version || (Bokeh.versions !== undefined && Bokeh.versions.has(py_version)));\n root._bokeh_is_initializing = true\n root._bokeh_onload_callbacks = []\n if (!reloading && (!bokeh_loaded || is_dev)) {\n\troot.Bokeh = undefined;\n }\n load_libs(css_urls, js_urls, js_modules, js_exports, function() {\n\tconsole.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n\trun_inline_js();\n });\n }\n }\n // Give older versions of the autoload script a head-start to ensure\n // they initialize before we start loading newer version.\n setTimeout(load_or_wait, 100)\n}(window));", "application/vnd.holoviews_load.v0+json": "" }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": "\nif ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {\n window.PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {}, plot_index: []}\n}\n\n\n function JupyterCommManager() {\n }\n\n JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {\n if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n comm_manager.register_target(comm_id, function(comm) {\n comm.on_msg(msg_handler);\n });\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) {\n comm.onMsg = msg_handler;\n });\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n google.colab.kernel.comms.registerTarget(comm_id, (comm) => {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n console.log(message)\n var content = {data: message.data, comm_id};\n var buffers = []\n for (var buffer of message.buffers || []) {\n buffers.push(new DataView(buffer))\n }\n var metadata = message.metadata || {};\n var msg = {content, buffers, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n })\n }\n }\n\n JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {\n if (comm_id in window.PyViz.comms) {\n return window.PyViz.comms[comm_id];\n } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);\n if (msg_handler) {\n comm.on_msg(msg_handler);\n }\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n var comm = window.PyViz.kernels[plot_id].connectToComm(comm_id);\n comm.open();\n if (msg_handler) {\n comm.onMsg = msg_handler;\n }\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n var comm_promise = google.colab.kernel.comms.open(comm_id)\n comm_promise.then((comm) => {\n window.PyViz.comms[comm_id] = comm;\n if (msg_handler) {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n var content = {data: message.data};\n var metadata = message.metadata || {comm_id};\n var msg = {content, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n }\n }) \n var sendClosure = (data, metadata, buffers, disposeOnDone) => {\n return comm_promise.then((comm) => {\n comm.send(data, metadata, buffers, disposeOnDone);\n });\n };\n var comm = {\n send: sendClosure\n };\n }\n window.PyViz.comms[comm_id] = comm;\n return comm;\n }\n window.PyViz.comm_manager = new JupyterCommManager();\n \n\n\nvar JS_MIME_TYPE = 'application/javascript';\nvar HTML_MIME_TYPE = 'text/html';\nvar EXEC_MIME_TYPE = 'application/vnd.holoviews_exec.v0+json';\nvar CLASS_NAME = 'output';\n\n/**\n * Render data to the DOM node\n */\nfunction render(props, node) {\n var div = document.createElement(\"div\");\n var script = document.createElement(\"script\");\n node.appendChild(div);\n node.appendChild(script);\n}\n\n/**\n * Handle when a new output is added\n */\nfunction handle_add_output(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n return\n }\n var id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n if (id !== undefined) {\n var nchildren = toinsert.length;\n var html_node = toinsert[nchildren-1].children[0];\n html_node.innerHTML = output.data[HTML_MIME_TYPE];\n var scripts = [];\n var nodelist = html_node.querySelectorAll(\"script\");\n for (var i in nodelist) {\n if (nodelist.hasOwnProperty(i)) {\n scripts.push(nodelist[i])\n }\n }\n\n scripts.forEach( function (oldScript) {\n var newScript = document.createElement(\"script\");\n var attrs = [];\n var nodemap = oldScript.attributes;\n for (var j in nodemap) {\n if (nodemap.hasOwnProperty(j)) {\n attrs.push(nodemap[j])\n }\n }\n attrs.forEach(function(attr) { newScript.setAttribute(attr.name, attr.value) });\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n oldScript.parentNode.replaceChild(newScript, oldScript);\n });\n if (JS_MIME_TYPE in output.data) {\n toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];\n }\n output_area._hv_plot_id = id;\n if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {\n window.PyViz.plot_index[id] = Bokeh.index[id];\n } else {\n window.PyViz.plot_index[id] = null;\n }\n } else if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n}\n\n/**\n * Handle when an output is cleared or removed\n */\nfunction handle_clear_output(event, handle) {\n var id = handle.cell.output_area._hv_plot_id;\n var server_id = handle.cell.output_area._bokeh_server_id;\n if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !== undefined)) { return; }\n var comm = window.PyViz.comm_manager.get_client_comm(\"hv-extension-comm\", \"hv-extension-comm\", function () {});\n if (server_id !== null) {\n comm.send({event_type: 'server_delete', 'id': server_id});\n return;\n } else if (comm !== null) {\n comm.send({event_type: 'delete', 'id': id});\n }\n delete PyViz.plot_index[id];\n if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) {\n var doc = window.Bokeh.index[id].model.document\n doc.clear();\n const i = window.Bokeh.documents.indexOf(doc);\n if (i > -1) {\n window.Bokeh.documents.splice(i, 1);\n }\n }\n}\n\n/**\n * Handle kernel restart event\n */\nfunction handle_kernel_cleanup(event, handle) {\n delete PyViz.comms[\"hv-extension-comm\"];\n window.PyViz.plot_index = {}\n}\n\n/**\n * Handle update_display_data messages\n */\nfunction handle_update_output(event, handle) {\n handle_clear_output(event, {cell: {output_area: handle.output_area}})\n handle_add_output(event, handle)\n}\n\nfunction register_renderer(events, OutputArea) {\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[0]);\n element.append(toinsert);\n return toinsert\n }\n\n events.on('output_added.OutputArea', handle_add_output);\n events.on('output_updated.OutputArea', handle_update_output);\n events.on('clear_output.CodeCell', handle_clear_output);\n events.on('delete.Cell', handle_clear_output);\n events.on('kernel_ready.Kernel', handle_kernel_cleanup);\n\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n safe: true,\n index: 0\n });\n}\n\nif (window.Jupyter !== undefined) {\n try {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n } catch(err) {\n }\n}\n", "application/vnd.holoviews_load.v0+json": "" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import pipeline\n", "import settings\n", "from sqlalchemy import create_engine\n", "import pandas as pd\n", "import datetime as dt\n", "import api\n", "import table_schema as ts\n", "import db_operation as db\n", "import numpy as np\n", "import utils\n", "import hvplot.pandas # noqa\n", "pd.options.plotting.backend = 'holoviews'\n", "db_url = 'sqlite:///instance/local.db'" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "pipeline.left_fill_benchmark_profile()" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "pipeline.right_fill_bechmark_profile()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "benchmark_df = db.get_all_benchmark_profile()\n" ] }, { "cell_type": "code", "execution_count": 16, "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", "
dateweightdisplay_nametickersectoraggregate_sectorname
02023-07-310.345中国宝安000009.XSHE电气设备I 电池II 电池化学品III 综合 工业集团企业 工业工业ZGBA
12023-07-310.122南玻A000012.XSHE建筑材料I 玻璃制造II 玻璃制造III 非金属矿物制品业 玻璃 原材料原料与能源NBA
22023-07-310.264深科技000021.XSHE电子I 电子制造II 消费电子零部件及组装III 计算机、通信和其他电子设备制造业 安防设备...信息与通信SKJ
32023-07-310.060招商港口001872.XSHE交通运输I 航运港口II 港口III 水上运输业 港口 工业工业ZSGK
42023-07-310.142深圳能源000027.XSHE公用事业I 电力II 火电III 电力、热力生产和供应业 火电 公用事业公用事业SZNY
........................
4952023-07-310.085天岳先进688234.XSHG电子I 半导体II 半导体材料III 计算机、通信和其他电子设备制造业 半导体材料 信息技术信息与通信TYXJ
4962023-07-310.041南网科技688248.XSHG电气设备I 电网设备II 电网自动化III 专业技术服务业 电网自动化 工业工业NWKJ
4972023-07-310.040中复神鹰688295.XSHG化工I 化学纤维II 其他纤维III 化学纤维制造业 氨纶及其他化纤 原材料原料与能源ZFSY
4982023-07-310.182拓荆科技688072.XSHG电子I 半导体II 半导体设备III 专用设备制造业 半导体设备 信息技术信息与通信TJKJ
4992023-07-310.078首创证券601136.XSHG非银金融I 证券II 证券III 资本市场服务 证券公司 金融金融与地产SCZQ
\n", "

500 rows × 7 columns

\n", "
" ], "text/plain": [ " date weight display_name ticker \\\n", "0 2023-07-31 0.345 中国宝安 000009.XSHE \n", "1 2023-07-31 0.122 南玻A 000012.XSHE \n", "2 2023-07-31 0.264 深科技 000021.XSHE \n", "3 2023-07-31 0.060 招商港口 001872.XSHE \n", "4 2023-07-31 0.142 深圳能源 000027.XSHE \n", ".. ... ... ... ... \n", "495 2023-07-31 0.085 天岳先进 688234.XSHG \n", "496 2023-07-31 0.041 南网科技 688248.XSHG \n", "497 2023-07-31 0.040 中复神鹰 688295.XSHG \n", "498 2023-07-31 0.182 拓荆科技 688072.XSHG \n", "499 2023-07-31 0.078 首创证券 601136.XSHG \n", "\n", " sector aggregate_sector name \n", "0 电气设备I 电池II 电池化学品III 综合 工业集团企业 工业 工业 ZGBA \n", "1 建筑材料I 玻璃制造II 玻璃制造III 非金属矿物制品业 玻璃 原材料 原料与能源 NBA \n", "2 电子I 电子制造II 消费电子零部件及组装III 计算机、通信和其他电子设备制造业 安防设备... 信息与通信 SKJ \n", "3 交通运输I 航运港口II 港口III 水上运输业 港口 工业 工业 ZSGK \n", "4 公用事业I 电力II 火电III 电力、热力生产和供应业 火电 公用事业 公用事业 SZNY \n", ".. ... ... ... \n", "495 电子I 半导体II 半导体材料III 计算机、通信和其他电子设备制造业 半导体材料 信息技术 信息与通信 TYXJ \n", "496 电气设备I 电网设备II 电网自动化III 专业技术服务业 电网自动化 工业 工业 NWKJ \n", "497 化工I 化学纤维II 其他纤维III 化学纤维制造业 氨纶及其他化纤 原材料 原料与能源 ZFSY \n", "498 电子I 半导体II 半导体设备III 专用设备制造业 半导体设备 信息技术 信息与通信 TJKJ \n", "499 非银金融I 证券II 证券III 资本市场服务 证券公司 金融 金融与地产 SCZQ \n", "\n", "[500 rows x 7 columns]" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "benchmark_df" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": {}, "metadata": {}, "output_type": "display_data" }, { "ename": "KeyboardInterrupt", "evalue": "", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[15], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m benchmark_df\u001b[39m.\u001b[39mhvplot\u001b[39m.\u001b[39mline(x\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mdate\u001b[39m\u001b[39m'\u001b[39m,y\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mweight\u001b[39m\u001b[39m'\u001b[39m,by\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mticker\u001b[39m\u001b[39m'\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/IPython/core/displayhook.py:268\u001b[0m, in \u001b[0;36mDisplayHook.__call__\u001b[0;34m(self, result)\u001b[0m\n\u001b[1;32m 266\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mstart_displayhook()\n\u001b[1;32m 267\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mwrite_output_prompt()\n\u001b[0;32m--> 268\u001b[0m format_dict, md_dict \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mcompute_format_data(result)\n\u001b[1;32m 269\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mupdate_user_ns(result)\n\u001b[1;32m 270\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mfill_exec_result(result)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/IPython/core/displayhook.py:157\u001b[0m, in \u001b[0;36mDisplayHook.compute_format_data\u001b[0;34m(self, result)\u001b[0m\n\u001b[1;32m 127\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mcompute_format_data\u001b[39m(\u001b[39mself\u001b[39m, result):\n\u001b[1;32m 128\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\"Compute format data of the object to be displayed.\u001b[39;00m\n\u001b[1;32m 129\u001b[0m \n\u001b[1;32m 130\u001b[0m \u001b[39m The format data is a generalization of the :func:`repr` of an object.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 155\u001b[0m \n\u001b[1;32m 156\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 157\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mshell\u001b[39m.\u001b[39;49mdisplay_formatter\u001b[39m.\u001b[39;49mformat(result)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/IPython/core/formatters.py:149\u001b[0m, in \u001b[0;36mDisplayFormatter.format\u001b[0;34m(self, obj, include, exclude)\u001b[0m\n\u001b[1;32m 145\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mipython_display_formatter(obj):\n\u001b[1;32m 146\u001b[0m \u001b[39m# object handled itself, don't proceed\u001b[39;00m\n\u001b[1;32m 147\u001b[0m \u001b[39mreturn\u001b[39;00m {}, {}\n\u001b[0;32m--> 149\u001b[0m format_dict, md_dict \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mmimebundle_formatter(obj, include\u001b[39m=\u001b[39;49minclude, exclude\u001b[39m=\u001b[39;49mexclude)\n\u001b[1;32m 151\u001b[0m \u001b[39mif\u001b[39;00m format_dict \u001b[39mor\u001b[39;00m md_dict:\n\u001b[1;32m 152\u001b[0m \u001b[39mif\u001b[39;00m include:\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/decorator.py:232\u001b[0m, in \u001b[0;36mdecorate..fun\u001b[0;34m(*args, **kw)\u001b[0m\n\u001b[1;32m 230\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m kwsyntax:\n\u001b[1;32m 231\u001b[0m args, kw \u001b[39m=\u001b[39m fix(args, kw, sig)\n\u001b[0;32m--> 232\u001b[0m \u001b[39mreturn\u001b[39;00m caller(func, \u001b[39m*\u001b[39;49m(extras \u001b[39m+\u001b[39;49m args), \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkw)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/IPython/core/formatters.py:223\u001b[0m, in \u001b[0;36mcatch_format_error\u001b[0;34m(method, self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 221\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\"show traceback on failed format call\"\"\"\u001b[39;00m\n\u001b[1;32m 222\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 223\u001b[0m r \u001b[39m=\u001b[39m method(\u001b[39mself\u001b[39;49m, \u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n\u001b[1;32m 224\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mNotImplementedError\u001b[39;00m:\n\u001b[1;32m 225\u001b[0m \u001b[39m# don't warn on NotImplementedErrors\u001b[39;00m\n\u001b[1;32m 226\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_check_return(\u001b[39mNone\u001b[39;00m, args[\u001b[39m0\u001b[39m])\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/IPython/core/formatters.py:974\u001b[0m, in \u001b[0;36mMimeBundleFormatter.__call__\u001b[0;34m(self, obj, include, exclude)\u001b[0m\n\u001b[1;32m 971\u001b[0m method \u001b[39m=\u001b[39m get_real_method(obj, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mprint_method)\n\u001b[1;32m 973\u001b[0m \u001b[39mif\u001b[39;00m method \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[0;32m--> 974\u001b[0m \u001b[39mreturn\u001b[39;00m method(include\u001b[39m=\u001b[39;49minclude, exclude\u001b[39m=\u001b[39;49mexclude)\n\u001b[1;32m 975\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mNone\u001b[39;00m\n\u001b[1;32m 976\u001b[0m \u001b[39melse\u001b[39;00m:\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/holoviews/core/dimension.py:1290\u001b[0m, in \u001b[0;36mDimensioned._repr_mimebundle_\u001b[0;34m(self, include, exclude)\u001b[0m\n\u001b[1;32m 1283\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_repr_mimebundle_\u001b[39m(\u001b[39mself\u001b[39m, include\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m, exclude\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m):\n\u001b[1;32m 1284\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 1285\u001b[0m \u001b[39m Resolves the class hierarchy for the class rendering the\u001b[39;00m\n\u001b[1;32m 1286\u001b[0m \u001b[39m object using any display hooks registered on Store.display\u001b[39;00m\n\u001b[1;32m 1287\u001b[0m \u001b[39m hooks. The output of all registered display_hooks is then\u001b[39;00m\n\u001b[1;32m 1288\u001b[0m \u001b[39m combined and returned.\u001b[39;00m\n\u001b[1;32m 1289\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 1290\u001b[0m \u001b[39mreturn\u001b[39;00m Store\u001b[39m.\u001b[39;49mrender(\u001b[39mself\u001b[39;49m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/holoviews/core/options.py:1425\u001b[0m, in \u001b[0;36mStore.render\u001b[0;34m(cls, obj)\u001b[0m\n\u001b[1;32m 1423\u001b[0m data, metadata \u001b[39m=\u001b[39m {}, {}\n\u001b[1;32m 1424\u001b[0m \u001b[39mfor\u001b[39;00m hook \u001b[39min\u001b[39;00m hooks:\n\u001b[0;32m-> 1425\u001b[0m ret \u001b[39m=\u001b[39m hook(obj)\n\u001b[1;32m 1426\u001b[0m \u001b[39mif\u001b[39;00m ret \u001b[39mis\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 1427\u001b[0m \u001b[39mcontinue\u001b[39;00m\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:280\u001b[0m, in \u001b[0;36mpprint_display\u001b[0;34m(obj)\u001b[0m\n\u001b[1;32m 278\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m ip\u001b[39m.\u001b[39mdisplay_formatter\u001b[39m.\u001b[39mformatters[\u001b[39m'\u001b[39m\u001b[39mtext/plain\u001b[39m\u001b[39m'\u001b[39m]\u001b[39m.\u001b[39mpprint:\n\u001b[1;32m 279\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mNone\u001b[39;00m\n\u001b[0;32m--> 280\u001b[0m \u001b[39mreturn\u001b[39;00m display(obj, raw_output\u001b[39m=\u001b[39;49m\u001b[39mTrue\u001b[39;49;00m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:248\u001b[0m, in \u001b[0;36mdisplay\u001b[0;34m(obj, raw_output, **kwargs)\u001b[0m\n\u001b[1;32m 246\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, (CompositeOverlay, ViewableElement)):\n\u001b[1;32m 247\u001b[0m \u001b[39mwith\u001b[39;00m option_state(obj):\n\u001b[0;32m--> 248\u001b[0m output \u001b[39m=\u001b[39m element_display(obj)\n\u001b[1;32m 249\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, (Layout, NdLayout, AdjointLayout)):\n\u001b[1;32m 250\u001b[0m \u001b[39mwith\u001b[39;00m option_state(obj):\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:142\u001b[0m, in \u001b[0;36mdisplay_hook..wrapped\u001b[0;34m(element)\u001b[0m\n\u001b[1;32m 140\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m 141\u001b[0m max_frames \u001b[39m=\u001b[39m OutputSettings\u001b[39m.\u001b[39moptions[\u001b[39m'\u001b[39m\u001b[39mmax_frames\u001b[39m\u001b[39m'\u001b[39m]\n\u001b[0;32m--> 142\u001b[0m mimebundle \u001b[39m=\u001b[39m fn(element, max_frames\u001b[39m=\u001b[39;49mmax_frames)\n\u001b[1;32m 143\u001b[0m \u001b[39mif\u001b[39;00m mimebundle \u001b[39mis\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 144\u001b[0m \u001b[39mreturn\u001b[39;00m {}, {}\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:188\u001b[0m, in \u001b[0;36melement_display\u001b[0;34m(element, max_frames)\u001b[0m\n\u001b[1;32m 185\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mtype\u001b[39m(element) \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m Store\u001b[39m.\u001b[39mregistry[backend]:\n\u001b[1;32m 186\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mNone\u001b[39;00m\n\u001b[0;32m--> 188\u001b[0m \u001b[39mreturn\u001b[39;00m render(element)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/holoviews/ipython/display_hooks.py:69\u001b[0m, in \u001b[0;36mrender\u001b[0;34m(obj, **kwargs)\u001b[0m\n\u001b[1;32m 66\u001b[0m \u001b[39mif\u001b[39;00m renderer\u001b[39m.\u001b[39mfig \u001b[39m==\u001b[39m \u001b[39m'\u001b[39m\u001b[39mpdf\u001b[39m\u001b[39m'\u001b[39m:\n\u001b[1;32m 67\u001b[0m renderer \u001b[39m=\u001b[39m renderer\u001b[39m.\u001b[39minstance(fig\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mpng\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[0;32m---> 69\u001b[0m \u001b[39mreturn\u001b[39;00m renderer\u001b[39m.\u001b[39;49mcomponents(obj, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/holoviews/plotting/renderer.py:399\u001b[0m, in \u001b[0;36mRenderer.components\u001b[0;34m(self, obj, fmt, comm, **kwargs)\u001b[0m\n\u001b[1;32m 396\u001b[0m embed \u001b[39m=\u001b[39m (\u001b[39mnot\u001b[39;00m (dynamic \u001b[39mor\u001b[39;00m streams \u001b[39mor\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mwidget_mode \u001b[39m==\u001b[39m \u001b[39m'\u001b[39m\u001b[39mlive\u001b[39m\u001b[39m'\u001b[39m) \u001b[39mor\u001b[39;00m config\u001b[39m.\u001b[39membed)\n\u001b[1;32m 398\u001b[0m \u001b[39mif\u001b[39;00m embed \u001b[39mor\u001b[39;00m config\u001b[39m.\u001b[39mcomms \u001b[39m==\u001b[39m \u001b[39m'\u001b[39m\u001b[39mdefault\u001b[39m\u001b[39m'\u001b[39m:\n\u001b[0;32m--> 399\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_render_panel(plot, embed, comm)\n\u001b[1;32m 400\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_render_ipywidget(plot)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/holoviews/plotting/renderer.py:408\u001b[0m, in \u001b[0;36mRenderer._render_panel\u001b[0;34m(self, plot, embed, comm)\u001b[0m\n\u001b[1;32m 406\u001b[0m model \u001b[39m=\u001b[39m plot\u001b[39m.\u001b[39mlayout\u001b[39m.\u001b[39m_render_model(doc, comm)\n\u001b[1;32m 407\u001b[0m \u001b[39mif\u001b[39;00m embed:\n\u001b[0;32m--> 408\u001b[0m \u001b[39mreturn\u001b[39;00m render_model(model, comm)\n\u001b[1;32m 409\u001b[0m ref \u001b[39m=\u001b[39m model\u001b[39m.\u001b[39mref[\u001b[39m'\u001b[39m\u001b[39mid\u001b[39m\u001b[39m'\u001b[39m]\n\u001b[1;32m 410\u001b[0m manager \u001b[39m=\u001b[39m PnCommManager(comm_id\u001b[39m=\u001b[39mcomm\u001b[39m.\u001b[39mid, plot_id\u001b[39m=\u001b[39mref)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/panel/io/notebook.py:178\u001b[0m, in \u001b[0;36mrender_model\u001b[0;34m(model, comm, resources)\u001b[0m\n\u001b[1;32m 175\u001b[0m patch_model_css(model, dist_url\u001b[39m=\u001b[39mdist_url)\n\u001b[1;32m 176\u001b[0m model\u001b[39m.\u001b[39mdocument\u001b[39m.\u001b[39m_template_variables[\u001b[39m'\u001b[39m\u001b[39mdist_url\u001b[39m\u001b[39m'\u001b[39m] \u001b[39m=\u001b[39m dist_url\n\u001b[0;32m--> 178\u001b[0m (docs_json, [render_item]) \u001b[39m=\u001b[39m standalone_docs_json_and_render_items([model], suppress_callback_warning\u001b[39m=\u001b[39;49m\u001b[39mTrue\u001b[39;49;00m)\n\u001b[1;32m 179\u001b[0m div \u001b[39m=\u001b[39m div_for_render_item(render_item)\n\u001b[1;32m 180\u001b[0m render_json \u001b[39m=\u001b[39m render_item\u001b[39m.\u001b[39mto_json()\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/embed/util.py:330\u001b[0m, in \u001b[0;36mstandalone_docs_json_and_render_items\u001b[0;34m(models, suppress_callback_warning)\u001b[0m\n\u001b[1;32m 328\u001b[0m docs_json: \u001b[39mdict\u001b[39m[ID, DocJson] \u001b[39m=\u001b[39m {}\n\u001b[1;32m 329\u001b[0m \u001b[39mfor\u001b[39;00m doc, (docid, _) \u001b[39min\u001b[39;00m docs\u001b[39m.\u001b[39mitems():\n\u001b[0;32m--> 330\u001b[0m docs_json[docid] \u001b[39m=\u001b[39m doc\u001b[39m.\u001b[39;49mto_json(deferred\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m)\n\u001b[1;32m 332\u001b[0m render_items: \u001b[39mlist\u001b[39m[RenderItem] \u001b[39m=\u001b[39m []\n\u001b[1;32m 333\u001b[0m \u001b[39mfor\u001b[39;00m _, (docid, roots) \u001b[39min\u001b[39;00m docs\u001b[39m.\u001b[39mitems():\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/document/document.py:737\u001b[0m, in \u001b[0;36mDocument.to_json\u001b[0;34m(self, deferred)\u001b[0m\n\u001b[1;32m 735\u001b[0m serializer \u001b[39m=\u001b[39m Serializer(deferred\u001b[39m=\u001b[39mdeferred)\n\u001b[1;32m 736\u001b[0m defs \u001b[39m=\u001b[39m serializer\u001b[39m.\u001b[39mencode(data_models)\n\u001b[0;32m--> 737\u001b[0m roots \u001b[39m=\u001b[39m serializer\u001b[39m.\u001b[39;49mencode(\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_roots)\n\u001b[1;32m 738\u001b[0m callbacks \u001b[39m=\u001b[39m serializer\u001b[39m.\u001b[39mencode(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcallbacks\u001b[39m.\u001b[39m_js_event_callbacks)\n\u001b[1;32m 740\u001b[0m doc_json \u001b[39m=\u001b[39m DocJson(\n\u001b[1;32m 741\u001b[0m version\u001b[39m=\u001b[39m__version__,\n\u001b[1;32m 742\u001b[0m title\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mtitle,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 745\u001b[0m callbacks\u001b[39m=\u001b[39mcallbacks,\n\u001b[1;32m 746\u001b[0m )\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:252\u001b[0m, in \u001b[0;36mSerializer.encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident] \u001b[39m=\u001b[39m obj\n\u001b[1;32m 251\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 252\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode(obj)\n\u001b[1;32m 253\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 254\u001b[0m \u001b[39mdel\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:277\u001b[0m, in \u001b[0;36mSerializer._encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 275\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encode_tuple(obj)\n\u001b[1;32m 276\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, \u001b[39mlist\u001b[39m):\n\u001b[0;32m--> 277\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode_list(obj)\n\u001b[1;32m 278\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, \u001b[39mset\u001b[39m):\n\u001b[1;32m 279\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encode_set(obj)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:323\u001b[0m, in \u001b[0;36mSerializer._encode_list\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode_list\u001b[39m(\u001b[39mself\u001b[39m, obj: \u001b[39mlist\u001b[39m[Any]) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ArrayRepLike:\n\u001b[0;32m--> 323\u001b[0m \u001b[39mreturn\u001b[39;00m [\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mencode(item) \u001b[39mfor\u001b[39;49;00m item \u001b[39min\u001b[39;49;00m obj]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:323\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode_list\u001b[39m(\u001b[39mself\u001b[39m, obj: \u001b[39mlist\u001b[39m[Any]) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ArrayRepLike:\n\u001b[0;32m--> 323\u001b[0m \u001b[39mreturn\u001b[39;00m [\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mencode(item) \u001b[39mfor\u001b[39;00m item \u001b[39min\u001b[39;00m obj]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:252\u001b[0m, in \u001b[0;36mSerializer.encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident] \u001b[39m=\u001b[39m obj\n\u001b[1;32m 251\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 252\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode(obj)\n\u001b[1;32m 253\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 254\u001b[0m \u001b[39mdel\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:261\u001b[0m, in \u001b[0;36mSerializer._encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 259\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode\u001b[39m(\u001b[39mself\u001b[39m, obj: Any) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m AnyRep:\n\u001b[1;32m 260\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, Serializable):\n\u001b[0;32m--> 261\u001b[0m \u001b[39mreturn\u001b[39;00m obj\u001b[39m.\u001b[39;49mto_serializable(\u001b[39mself\u001b[39;49m)\n\u001b[1;32m 262\u001b[0m \u001b[39melif\u001b[39;00m (encoder \u001b[39m:=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encoders\u001b[39m.\u001b[39mget(\u001b[39mtype\u001b[39m(obj))) \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 263\u001b[0m \u001b[39mreturn\u001b[39;00m encoder(obj, \u001b[39mself\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/model/model.py:525\u001b[0m, in \u001b[0;36mModel.to_serializable\u001b[0;34m(self, serializer)\u001b[0m\n\u001b[1;32m 522\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mto_serializable\u001b[39m(\u001b[39mself\u001b[39m, serializer: Serializer) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ObjectRefRep:\n\u001b[1;32m 523\u001b[0m serializer\u001b[39m.\u001b[39madd_ref(\u001b[39mself\u001b[39m, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mref)\n\u001b[0;32m--> 525\u001b[0m super_rep \u001b[39m=\u001b[39m \u001b[39msuper\u001b[39;49m()\u001b[39m.\u001b[39;49mto_serializable(serializer)\n\u001b[1;32m 526\u001b[0m rep \u001b[39m=\u001b[39m ObjectRefRep(\n\u001b[1;32m 527\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 528\u001b[0m name\u001b[39m=\u001b[39msuper_rep[\u001b[39m\"\u001b[39m\u001b[39mname\u001b[39m\u001b[39m\"\u001b[39m],\n\u001b[1;32m 529\u001b[0m \u001b[39mid\u001b[39m\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mid,\n\u001b[1;32m 530\u001b[0m )\n\u001b[1;32m 532\u001b[0m attributes \u001b[39m=\u001b[39m super_rep\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mattributes\u001b[39m\u001b[39m\"\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/has_props.py:406\u001b[0m, in \u001b[0;36mHasProps.to_serializable\u001b[0;34m(self, serializer)\u001b[0m\n\u001b[1;32m 400\u001b[0m rep \u001b[39m=\u001b[39m ObjectRep(\n\u001b[1;32m 401\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 402\u001b[0m name\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m__qualified_model__,\n\u001b[1;32m 403\u001b[0m )\n\u001b[1;32m 405\u001b[0m properties \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mproperties_with_values(include_defaults\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m)\n\u001b[0;32m--> 406\u001b[0m attributes \u001b[39m=\u001b[39m {key: serializer\u001b[39m.\u001b[39;49mencode(val) \u001b[39mfor\u001b[39;49;00m key, val \u001b[39min\u001b[39;49;00m properties\u001b[39m.\u001b[39;49mitems()}\n\u001b[1;32m 408\u001b[0m \u001b[39mif\u001b[39;00m attributes:\n\u001b[1;32m 409\u001b[0m rep[\u001b[39m\"\u001b[39m\u001b[39mattributes\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m attributes\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/has_props.py:406\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 400\u001b[0m rep \u001b[39m=\u001b[39m ObjectRep(\n\u001b[1;32m 401\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 402\u001b[0m name\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m__qualified_model__,\n\u001b[1;32m 403\u001b[0m )\n\u001b[1;32m 405\u001b[0m properties \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mproperties_with_values(include_defaults\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m)\n\u001b[0;32m--> 406\u001b[0m attributes \u001b[39m=\u001b[39m {key: serializer\u001b[39m.\u001b[39;49mencode(val) \u001b[39mfor\u001b[39;00m key, val \u001b[39min\u001b[39;00m properties\u001b[39m.\u001b[39mitems()}\n\u001b[1;32m 408\u001b[0m \u001b[39mif\u001b[39;00m attributes:\n\u001b[1;32m 409\u001b[0m rep[\u001b[39m\"\u001b[39m\u001b[39mattributes\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m attributes\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:252\u001b[0m, in \u001b[0;36mSerializer.encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident] \u001b[39m=\u001b[39m obj\n\u001b[1;32m 251\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 252\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode(obj)\n\u001b[1;32m 253\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 254\u001b[0m \u001b[39mdel\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:277\u001b[0m, in \u001b[0;36mSerializer._encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 275\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encode_tuple(obj)\n\u001b[1;32m 276\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, \u001b[39mlist\u001b[39m):\n\u001b[0;32m--> 277\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode_list(obj)\n\u001b[1;32m 278\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, \u001b[39mset\u001b[39m):\n\u001b[1;32m 279\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encode_set(obj)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:323\u001b[0m, in \u001b[0;36mSerializer._encode_list\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode_list\u001b[39m(\u001b[39mself\u001b[39m, obj: \u001b[39mlist\u001b[39m[Any]) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ArrayRepLike:\n\u001b[0;32m--> 323\u001b[0m \u001b[39mreturn\u001b[39;00m [\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mencode(item) \u001b[39mfor\u001b[39;49;00m item \u001b[39min\u001b[39;49;00m obj]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:323\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode_list\u001b[39m(\u001b[39mself\u001b[39m, obj: \u001b[39mlist\u001b[39m[Any]) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ArrayRepLike:\n\u001b[0;32m--> 323\u001b[0m \u001b[39mreturn\u001b[39;00m [\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mencode(item) \u001b[39mfor\u001b[39;00m item \u001b[39min\u001b[39;00m obj]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:252\u001b[0m, in \u001b[0;36mSerializer.encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident] \u001b[39m=\u001b[39m obj\n\u001b[1;32m 251\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 252\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode(obj)\n\u001b[1;32m 253\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 254\u001b[0m \u001b[39mdel\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:261\u001b[0m, in \u001b[0;36mSerializer._encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 259\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode\u001b[39m(\u001b[39mself\u001b[39m, obj: Any) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m AnyRep:\n\u001b[1;32m 260\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, Serializable):\n\u001b[0;32m--> 261\u001b[0m \u001b[39mreturn\u001b[39;00m obj\u001b[39m.\u001b[39;49mto_serializable(\u001b[39mself\u001b[39;49m)\n\u001b[1;32m 262\u001b[0m \u001b[39melif\u001b[39;00m (encoder \u001b[39m:=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encoders\u001b[39m.\u001b[39mget(\u001b[39mtype\u001b[39m(obj))) \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 263\u001b[0m \u001b[39mreturn\u001b[39;00m encoder(obj, \u001b[39mself\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/model/model.py:525\u001b[0m, in \u001b[0;36mModel.to_serializable\u001b[0;34m(self, serializer)\u001b[0m\n\u001b[1;32m 522\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mto_serializable\u001b[39m(\u001b[39mself\u001b[39m, serializer: Serializer) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ObjectRefRep:\n\u001b[1;32m 523\u001b[0m serializer\u001b[39m.\u001b[39madd_ref(\u001b[39mself\u001b[39m, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mref)\n\u001b[0;32m--> 525\u001b[0m super_rep \u001b[39m=\u001b[39m \u001b[39msuper\u001b[39;49m()\u001b[39m.\u001b[39;49mto_serializable(serializer)\n\u001b[1;32m 526\u001b[0m rep \u001b[39m=\u001b[39m ObjectRefRep(\n\u001b[1;32m 527\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 528\u001b[0m name\u001b[39m=\u001b[39msuper_rep[\u001b[39m\"\u001b[39m\u001b[39mname\u001b[39m\u001b[39m\"\u001b[39m],\n\u001b[1;32m 529\u001b[0m \u001b[39mid\u001b[39m\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mid,\n\u001b[1;32m 530\u001b[0m )\n\u001b[1;32m 532\u001b[0m attributes \u001b[39m=\u001b[39m super_rep\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mattributes\u001b[39m\u001b[39m\"\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/has_props.py:406\u001b[0m, in \u001b[0;36mHasProps.to_serializable\u001b[0;34m(self, serializer)\u001b[0m\n\u001b[1;32m 400\u001b[0m rep \u001b[39m=\u001b[39m ObjectRep(\n\u001b[1;32m 401\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 402\u001b[0m name\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m__qualified_model__,\n\u001b[1;32m 403\u001b[0m )\n\u001b[1;32m 405\u001b[0m properties \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mproperties_with_values(include_defaults\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m)\n\u001b[0;32m--> 406\u001b[0m attributes \u001b[39m=\u001b[39m {key: serializer\u001b[39m.\u001b[39;49mencode(val) \u001b[39mfor\u001b[39;49;00m key, val \u001b[39min\u001b[39;49;00m properties\u001b[39m.\u001b[39;49mitems()}\n\u001b[1;32m 408\u001b[0m \u001b[39mif\u001b[39;00m attributes:\n\u001b[1;32m 409\u001b[0m rep[\u001b[39m\"\u001b[39m\u001b[39mattributes\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m attributes\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/has_props.py:406\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 400\u001b[0m rep \u001b[39m=\u001b[39m ObjectRep(\n\u001b[1;32m 401\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 402\u001b[0m name\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m__qualified_model__,\n\u001b[1;32m 403\u001b[0m )\n\u001b[1;32m 405\u001b[0m properties \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mproperties_with_values(include_defaults\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m)\n\u001b[0;32m--> 406\u001b[0m attributes \u001b[39m=\u001b[39m {key: serializer\u001b[39m.\u001b[39;49mencode(val) \u001b[39mfor\u001b[39;00m key, val \u001b[39min\u001b[39;00m properties\u001b[39m.\u001b[39mitems()}\n\u001b[1;32m 408\u001b[0m \u001b[39mif\u001b[39;00m attributes:\n\u001b[1;32m 409\u001b[0m rep[\u001b[39m\"\u001b[39m\u001b[39mattributes\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m attributes\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:252\u001b[0m, in \u001b[0;36mSerializer.encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident] \u001b[39m=\u001b[39m obj\n\u001b[1;32m 251\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 252\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode(obj)\n\u001b[1;32m 253\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 254\u001b[0m \u001b[39mdel\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:277\u001b[0m, in \u001b[0;36mSerializer._encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 275\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encode_tuple(obj)\n\u001b[1;32m 276\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, \u001b[39mlist\u001b[39m):\n\u001b[0;32m--> 277\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode_list(obj)\n\u001b[1;32m 278\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, \u001b[39mset\u001b[39m):\n\u001b[1;32m 279\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encode_set(obj)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:323\u001b[0m, in \u001b[0;36mSerializer._encode_list\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode_list\u001b[39m(\u001b[39mself\u001b[39m, obj: \u001b[39mlist\u001b[39m[Any]) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ArrayRepLike:\n\u001b[0;32m--> 323\u001b[0m \u001b[39mreturn\u001b[39;00m [\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mencode(item) \u001b[39mfor\u001b[39;49;00m item \u001b[39min\u001b[39;49;00m obj]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:323\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode_list\u001b[39m(\u001b[39mself\u001b[39m, obj: \u001b[39mlist\u001b[39m[Any]) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ArrayRepLike:\n\u001b[0;32m--> 323\u001b[0m \u001b[39mreturn\u001b[39;00m [\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mencode(item) \u001b[39mfor\u001b[39;00m item \u001b[39min\u001b[39;00m obj]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:252\u001b[0m, in \u001b[0;36mSerializer.encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident] \u001b[39m=\u001b[39m obj\n\u001b[1;32m 251\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 252\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode(obj)\n\u001b[1;32m 253\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 254\u001b[0m \u001b[39mdel\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:261\u001b[0m, in \u001b[0;36mSerializer._encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 259\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode\u001b[39m(\u001b[39mself\u001b[39m, obj: Any) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m AnyRep:\n\u001b[1;32m 260\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, Serializable):\n\u001b[0;32m--> 261\u001b[0m \u001b[39mreturn\u001b[39;00m obj\u001b[39m.\u001b[39;49mto_serializable(\u001b[39mself\u001b[39;49m)\n\u001b[1;32m 262\u001b[0m \u001b[39melif\u001b[39;00m (encoder \u001b[39m:=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encoders\u001b[39m.\u001b[39mget(\u001b[39mtype\u001b[39m(obj))) \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 263\u001b[0m \u001b[39mreturn\u001b[39;00m encoder(obj, \u001b[39mself\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/model/model.py:525\u001b[0m, in \u001b[0;36mModel.to_serializable\u001b[0;34m(self, serializer)\u001b[0m\n\u001b[1;32m 522\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mto_serializable\u001b[39m(\u001b[39mself\u001b[39m, serializer: Serializer) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ObjectRefRep:\n\u001b[1;32m 523\u001b[0m serializer\u001b[39m.\u001b[39madd_ref(\u001b[39mself\u001b[39m, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mref)\n\u001b[0;32m--> 525\u001b[0m super_rep \u001b[39m=\u001b[39m \u001b[39msuper\u001b[39;49m()\u001b[39m.\u001b[39;49mto_serializable(serializer)\n\u001b[1;32m 526\u001b[0m rep \u001b[39m=\u001b[39m ObjectRefRep(\n\u001b[1;32m 527\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 528\u001b[0m name\u001b[39m=\u001b[39msuper_rep[\u001b[39m\"\u001b[39m\u001b[39mname\u001b[39m\u001b[39m\"\u001b[39m],\n\u001b[1;32m 529\u001b[0m \u001b[39mid\u001b[39m\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mid,\n\u001b[1;32m 530\u001b[0m )\n\u001b[1;32m 532\u001b[0m attributes \u001b[39m=\u001b[39m super_rep\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mattributes\u001b[39m\u001b[39m\"\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/has_props.py:406\u001b[0m, in \u001b[0;36mHasProps.to_serializable\u001b[0;34m(self, serializer)\u001b[0m\n\u001b[1;32m 400\u001b[0m rep \u001b[39m=\u001b[39m ObjectRep(\n\u001b[1;32m 401\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 402\u001b[0m name\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m__qualified_model__,\n\u001b[1;32m 403\u001b[0m )\n\u001b[1;32m 405\u001b[0m properties \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mproperties_with_values(include_defaults\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m)\n\u001b[0;32m--> 406\u001b[0m attributes \u001b[39m=\u001b[39m {key: serializer\u001b[39m.\u001b[39;49mencode(val) \u001b[39mfor\u001b[39;49;00m key, val \u001b[39min\u001b[39;49;00m properties\u001b[39m.\u001b[39;49mitems()}\n\u001b[1;32m 408\u001b[0m \u001b[39mif\u001b[39;00m attributes:\n\u001b[1;32m 409\u001b[0m rep[\u001b[39m\"\u001b[39m\u001b[39mattributes\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m attributes\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/has_props.py:406\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 400\u001b[0m rep \u001b[39m=\u001b[39m ObjectRep(\n\u001b[1;32m 401\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 402\u001b[0m name\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m__qualified_model__,\n\u001b[1;32m 403\u001b[0m )\n\u001b[1;32m 405\u001b[0m properties \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mproperties_with_values(include_defaults\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m)\n\u001b[0;32m--> 406\u001b[0m attributes \u001b[39m=\u001b[39m {key: serializer\u001b[39m.\u001b[39;49mencode(val) \u001b[39mfor\u001b[39;00m key, val \u001b[39min\u001b[39;00m properties\u001b[39m.\u001b[39mitems()}\n\u001b[1;32m 408\u001b[0m \u001b[39mif\u001b[39;00m attributes:\n\u001b[1;32m 409\u001b[0m rep[\u001b[39m\"\u001b[39m\u001b[39mattributes\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m attributes\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:252\u001b[0m, in \u001b[0;36mSerializer.encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident] \u001b[39m=\u001b[39m obj\n\u001b[1;32m 251\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 252\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode(obj)\n\u001b[1;32m 253\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 254\u001b[0m \u001b[39mdel\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:277\u001b[0m, in \u001b[0;36mSerializer._encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 275\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encode_tuple(obj)\n\u001b[1;32m 276\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, \u001b[39mlist\u001b[39m):\n\u001b[0;32m--> 277\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode_list(obj)\n\u001b[1;32m 278\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, \u001b[39mset\u001b[39m):\n\u001b[1;32m 279\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encode_set(obj)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:323\u001b[0m, in \u001b[0;36mSerializer._encode_list\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode_list\u001b[39m(\u001b[39mself\u001b[39m, obj: \u001b[39mlist\u001b[39m[Any]) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ArrayRepLike:\n\u001b[0;32m--> 323\u001b[0m \u001b[39mreturn\u001b[39;00m [\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mencode(item) \u001b[39mfor\u001b[39;49;00m item \u001b[39min\u001b[39;49;00m obj]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:323\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode_list\u001b[39m(\u001b[39mself\u001b[39m, obj: \u001b[39mlist\u001b[39m[Any]) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ArrayRepLike:\n\u001b[0;32m--> 323\u001b[0m \u001b[39mreturn\u001b[39;00m [\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mencode(item) \u001b[39mfor\u001b[39;00m item \u001b[39min\u001b[39;00m obj]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:252\u001b[0m, in \u001b[0;36mSerializer.encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident] \u001b[39m=\u001b[39m obj\n\u001b[1;32m 251\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 252\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_encode(obj)\n\u001b[1;32m 253\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 254\u001b[0m \u001b[39mdel\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_circular[ident]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/serialization.py:261\u001b[0m, in \u001b[0;36mSerializer._encode\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 259\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_encode\u001b[39m(\u001b[39mself\u001b[39m, obj: Any) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m AnyRep:\n\u001b[1;32m 260\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(obj, Serializable):\n\u001b[0;32m--> 261\u001b[0m \u001b[39mreturn\u001b[39;00m obj\u001b[39m.\u001b[39;49mto_serializable(\u001b[39mself\u001b[39;49m)\n\u001b[1;32m 262\u001b[0m \u001b[39melif\u001b[39;00m (encoder \u001b[39m:=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_encoders\u001b[39m.\u001b[39mget(\u001b[39mtype\u001b[39m(obj))) \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 263\u001b[0m \u001b[39mreturn\u001b[39;00m encoder(obj, \u001b[39mself\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/model/model.py:525\u001b[0m, in \u001b[0;36mModel.to_serializable\u001b[0;34m(self, serializer)\u001b[0m\n\u001b[1;32m 522\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mto_serializable\u001b[39m(\u001b[39mself\u001b[39m, serializer: Serializer) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ObjectRefRep:\n\u001b[1;32m 523\u001b[0m serializer\u001b[39m.\u001b[39madd_ref(\u001b[39mself\u001b[39m, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mref)\n\u001b[0;32m--> 525\u001b[0m super_rep \u001b[39m=\u001b[39m \u001b[39msuper\u001b[39;49m()\u001b[39m.\u001b[39;49mto_serializable(serializer)\n\u001b[1;32m 526\u001b[0m rep \u001b[39m=\u001b[39m ObjectRefRep(\n\u001b[1;32m 527\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 528\u001b[0m name\u001b[39m=\u001b[39msuper_rep[\u001b[39m\"\u001b[39m\u001b[39mname\u001b[39m\u001b[39m\"\u001b[39m],\n\u001b[1;32m 529\u001b[0m \u001b[39mid\u001b[39m\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mid,\n\u001b[1;32m 530\u001b[0m )\n\u001b[1;32m 532\u001b[0m attributes \u001b[39m=\u001b[39m super_rep\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mattributes\u001b[39m\u001b[39m\"\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/has_props.py:405\u001b[0m, in \u001b[0;36mHasProps.to_serializable\u001b[0;34m(self, serializer)\u001b[0m\n\u001b[1;32m 399\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mto_serializable\u001b[39m(\u001b[39mself\u001b[39m, serializer: Serializer) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m ObjectRep:\n\u001b[1;32m 400\u001b[0m rep \u001b[39m=\u001b[39m ObjectRep(\n\u001b[1;32m 401\u001b[0m \u001b[39mtype\u001b[39m\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mobject\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 402\u001b[0m name\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m__qualified_model__,\n\u001b[1;32m 403\u001b[0m )\n\u001b[0;32m--> 405\u001b[0m properties \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mproperties_with_values(include_defaults\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m)\n\u001b[1;32m 406\u001b[0m attributes \u001b[39m=\u001b[39m {key: serializer\u001b[39m.\u001b[39mencode(val) \u001b[39mfor\u001b[39;00m key, val \u001b[39min\u001b[39;00m properties\u001b[39m.\u001b[39mitems()}\n\u001b[1;32m 408\u001b[0m \u001b[39mif\u001b[39;00m attributes:\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/has_props.py:592\u001b[0m, in \u001b[0;36mHasProps.properties_with_values\u001b[0;34m(self, include_defaults, include_undefined)\u001b[0m\n\u001b[1;32m 571\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mproperties_with_values\u001b[39m(\u001b[39mself\u001b[39m, \u001b[39m*\u001b[39m, include_defaults: \u001b[39mbool\u001b[39m \u001b[39m=\u001b[39m \u001b[39mTrue\u001b[39;00m, include_undefined: \u001b[39mbool\u001b[39m \u001b[39m=\u001b[39m \u001b[39mFalse\u001b[39;00m) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m \u001b[39mdict\u001b[39m[\u001b[39mstr\u001b[39m, Any]:\n\u001b[1;32m 572\u001b[0m \u001b[39m \u001b[39m\u001b[39m''' Collect a dict mapping property names to their values.\u001b[39;00m\n\u001b[1;32m 573\u001b[0m \n\u001b[1;32m 574\u001b[0m \u001b[39m This method *always* traverses the class hierarchy and includes\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 590\u001b[0m \n\u001b[1;32m 591\u001b[0m \u001b[39m '''\u001b[39;00m\n\u001b[0;32m--> 592\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mquery_properties_with_values(\u001b[39mlambda\u001b[39;49;00m prop: prop\u001b[39m.\u001b[39;49mserialized,\n\u001b[1;32m 593\u001b[0m include_defaults\u001b[39m=\u001b[39;49minclude_defaults, include_undefined\u001b[39m=\u001b[39;49minclude_undefined)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/has_props.py:649\u001b[0m, in \u001b[0;36mHasProps.query_properties_with_values\u001b[0;34m(self, query, include_defaults, include_undefined)\u001b[0m\n\u001b[1;32m 646\u001b[0m \u001b[39mcontinue\u001b[39;00m\n\u001b[1;32m 648\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 649\u001b[0m value \u001b[39m=\u001b[39m descriptor\u001b[39m.\u001b[39;49mget_value(\u001b[39mself\u001b[39;49m)\n\u001b[1;32m 650\u001b[0m \u001b[39mexcept\u001b[39;00m UnsetValueError:\n\u001b[1;32m 651\u001b[0m \u001b[39mif\u001b[39;00m include_undefined:\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/property/descriptors.py:395\u001b[0m, in \u001b[0;36mPropertyDescriptor.get_value\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 381\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mget_value\u001b[39m(\u001b[39mself\u001b[39m, obj: HasProps) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m Any:\n\u001b[1;32m 382\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\" Produce the value used for serialization.\u001b[39;00m\n\u001b[1;32m 383\u001b[0m \n\u001b[1;32m 384\u001b[0m \u001b[39m Sometimes it is desirable for the serialized value to differ from\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 393\u001b[0m \n\u001b[1;32m 394\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 395\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m\u001b[39m__get__\u001b[39;49m(obj, obj\u001b[39m.\u001b[39;49m\u001b[39m__class__\u001b[39;49m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/property/descriptors.py:281\u001b[0m, in \u001b[0;36mPropertyDescriptor.__get__\u001b[0;34m(self, obj, owner)\u001b[0m\n\u001b[1;32m 247\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\" Implement the getter for the Python `descriptor protocol`_.\u001b[39;00m\n\u001b[1;32m 248\u001b[0m \n\u001b[1;32m 249\u001b[0m \u001b[39mFor instance attribute access, we delegate to the |Property|. For\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 278\u001b[0m \n\u001b[1;32m 279\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 280\u001b[0m \u001b[39mif\u001b[39;00m obj \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[0;32m--> 281\u001b[0m value \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_get(obj)\n\u001b[1;32m 282\u001b[0m \u001b[39mif\u001b[39;00m value \u001b[39mis\u001b[39;00m Undefined:\n\u001b[1;32m 283\u001b[0m \u001b[39mraise\u001b[39;00m UnsetValueError(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m{\u001b[39;00mobj\u001b[39m}\u001b[39;00m\u001b[39m.\u001b[39m\u001b[39m{\u001b[39;00m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mname\u001b[39m}\u001b[39;00m\u001b[39m doesn\u001b[39m\u001b[39m'\u001b[39m\u001b[39mt have a value set\u001b[39m\u001b[39m\"\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/property/descriptors.py:515\u001b[0m, in \u001b[0;36mPropertyDescriptor._get\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 512\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mRuntimeError\u001b[39;00m(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mCannot get a property value \u001b[39m\u001b[39m{\u001b[39;00m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mname\u001b[39m!r}\u001b[39;00m\u001b[39m from a \u001b[39m\u001b[39m{\u001b[39;00mclass_name\u001b[39m}\u001b[39;00m\u001b[39m instance before HasProps.__init__\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m 514\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mname \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m obj\u001b[39m.\u001b[39m_property_values:\n\u001b[0;32m--> 515\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_get_default(obj)\n\u001b[1;32m 516\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 517\u001b[0m \u001b[39mreturn\u001b[39;00m obj\u001b[39m.\u001b[39m_property_values[\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mname]\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/property/descriptors.py:540\u001b[0m, in \u001b[0;36mPropertyDescriptor._get_default\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 537\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mname \u001b[39min\u001b[39;00m unstable_dict:\n\u001b[1;32m 538\u001b[0m \u001b[39mreturn\u001b[39;00m unstable_dict[\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mname]\n\u001b[0;32m--> 540\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mhas_unstable_default(obj):\n\u001b[1;32m 541\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(default, PropertyValueContainer):\n\u001b[1;32m 542\u001b[0m default\u001b[39m.\u001b[39m_register_owner(obj, \u001b[39mself\u001b[39m)\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/property/descriptors.py:484\u001b[0m, in \u001b[0;36mPropertyDescriptor.has_unstable_default\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 481\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mhas_unstable_default\u001b[39m(\u001b[39mself\u001b[39m, obj: HasProps) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m \u001b[39mbool\u001b[39m:\n\u001b[1;32m 482\u001b[0m \u001b[39m# _may_have_unstable_default() doesn't have access to overrides, so check manually\u001b[39;00m\n\u001b[1;32m 483\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mproperty\u001b[39m.\u001b[39m_may_have_unstable_default() \u001b[39mor\u001b[39;00m \\\n\u001b[0;32m--> 484\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mis_unstable(obj\u001b[39m.\u001b[39;49m__overridden_defaults__\u001b[39m.\u001b[39;49mget(\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mname, \u001b[39mNone\u001b[39;49;00m))\n", "File \u001b[0;32m~/miniconda3/envs/risk-dashboard/lib/python3.11/site-packages/bokeh/core/property/descriptors.py:489\u001b[0m, in \u001b[0;36mPropertyDescriptor.is_unstable\u001b[0;34m(cls, value)\u001b[0m\n\u001b[1;32m 486\u001b[0m \u001b[39m@classmethod\u001b[39m\n\u001b[1;32m 487\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mis_unstable\u001b[39m(\u001b[39mcls\u001b[39m, value: Any) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m TypeGuard[Callable[[], Any]]:\n\u001b[1;32m 488\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39m.\u001b[39;00m\u001b[39minstance\u001b[39;00m \u001b[39mimport\u001b[39;00m InstanceDefault\n\u001b[0;32m--> 489\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39misinstance\u001b[39;49m(value, (FunctionType, InstanceDefault))\n", "\u001b[0;31mKeyboardInterrupt\u001b[0m: " ] } ], "source": [ "benchmark_df.hvplot.line(x='date',y='weight',by='ticker')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# unique ticker list\n", "portfolio_p = db.get_all_portfolio_profile()\n", "ticker_list = portfolio_p['ticker'].unique().tolist()\n", "price_df = db.get_stocks_price(ticker_list)\n", "\n", "portfolio_p = db.get_all_portfolio_profile()\n", "## temperaraly handle rename date to time\n", "portfolio_p.rename(columns={'date': 'time','weight':'ini_w'}, inplace=True)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": {}, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.holoviews_exec.v0+json": "", "text/html": [ "
\n", "
\n", "
\n", "" ], "text/plain": [ ":NdOverlay [ticker]\n", " :Curve [time] (close)" ] }, "execution_count": 4, "metadata": { "application/vnd.holoviews_exec.v0+json": { "id": "p1002" } }, "output_type": "execute_result" } ], "source": [ "price_df.hvplot.line(x='time', y='close', by='ticker', width=1000, height=400)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "def _uniformize_time_series(profile_df):\n", " '''\n", " a helper function to create analytic_df \n", " \n", " make each entry in the time series has the same dimension\n", " by filling none holding stock that was held in previous period has 0 shares and 0 ini_w\n", "\n", " Parameters\n", " ----------\n", " profile_df : dataframe\n", " portfolio profile dataframe or benchmark profile dataframe\n", " \n", " Returns\n", " -------\n", " dataframe\n", " dataframe with uniformized time series\n", " '''\n", " # Get unique time periods\n", " time_periods = profile_df['time'].unique()\n", " time_periods = sorted(time_periods)\n", "\n", " # Iterate through time periods\n", " for i in range(len(time_periods) - 1):\n", " current_period = time_periods[i]\n", " next_period = time_periods[i + 1]\n", " \n", " current_df = profile_df[profile_df['time'] == current_period]\n", " next_df = profile_df[profile_df['time'] == next_period]\n", " \n", " tickers_current = current_df['ticker']\n", " tickers_next = next_df['ticker']\n", " \n", " # row that has ticker not in tickers_next\n", " missing_tickers = current_df[~tickers_current.isin(tickers_next)].copy()\n", " \n", " if len(missing_tickers) != 0:\n", " missing_tickers.time = next_period\n", " missing_tickers.shares = 0\n", " missing_tickers.ini_w = 0\n", " profile_df = pd.concat([profile_df, missing_tickers], ignore_index=True)\n", " # reset index\n", " return profile_df.reset_index(drop=True)\n" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "# create a merged_df \n", "def create_analytic_df(price_df, profile_df):\n", " '''\n", " create a df for analysis processing\n", "\n", "\n", " '''\n", " uni_profile_df = _uniformize_time_series(profile_df)\n", " #TODO handle rename column here\n", " df = price_df.merge(uni_profile_df, on=['ticker','time'], how='outer')\n", " df.sort_values(by=['ticker','time'], inplace=True)\n", " # add sector, aggregate_sector, display_name and name to missing rows\n", " grouped = df.groupby('ticker')\n", " df['sector'] = grouped['sector'].fillna(method='ffill')\n", " df['aggregate_sector'] = grouped['aggregate_sector'].fillna(method='ffill')\n", " df['display_name'] = grouped['display_name'].fillna(method='ffill')\n", " df['name'] = grouped['name'].fillna(method='ffill')\n", "\n", " # assign missing ini_w\n", " df['ini_w'] = grouped['ini_w'].fillna(method='ffill')\n", " # assign missing shares\n", " df['shares'] = grouped['shares'].fillna(method='ffill')\n", " # remove profile and price entry before first profile entry from df\n", " df.dropna(subset=['ini_w'], inplace=True)\n", " df.dropna(subset=['close'], inplace=True)\n", " # remove where weight is 0\n", " df = df[df['shares'] != 0].copy()\n", " return df\n" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "def calculate_weight_using_cash(df):\n", " '''\n", " patch df with current weight for each entry\n", " use cash to calculate weight\n", " \n", " Parameters\n", " ----------\n", " df : dataframe\n", " dataframe with processed cash column\n", " \n", " '''\n", " df['cur_w'] = float('nan')\n", " grouped = df.groupby('time')\n", " df.cur_w = grouped.cash.transform(lambda x: x / x.sum())\n", "\n", " " ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "def calculate_cash(df):\n", " '''\n", " patch df with cash column\n", " cash = shares * close\n", " \n", " Parameters\n", " ----------\n", " df : dataframe\n", " dataframe with processed shares and close column\n", " '''\n", " df['cash'] = df['shares'] * df['close']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def calculate_return(df, start, end):\n", " '''\n", " calculate cumulative return for each entry in the df\n", " '''\n", " selected_df = df[df.time.between(start, end)].copy()\n", " if len(selected_df) == 0:\n", " return selected_df\n", " selected_df.sort_values(by=['time'], inplace=True)\n", " selected_df['return'] = selected_df.groupby('ticker')" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": {}, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.holoviews_exec.v0+json": "", "text/html": [ "
\n", "
\n", "
\n", "" ], "text/plain": [ ":NdOverlay [ticker]\n", " :Curve [time] (cur_w)" ] }, "execution_count": 12, "metadata": { "application/vnd.holoviews_exec.v0+json": { "id": "p1793" } }, "output_type": "execute_result" } ], "source": [ "# merged_df is sorted on time\n", "analytic_df = create_analytic_df(price_df, portfolio_p)\n", "calculate_cash(analytic_df)\n", "calculate_weight_using_cash(analytic_df)\n", "# analytic_df['pct'] = analytic_df.groupby('ticker')['close'].pct_change()\n", "# calculate weight\n", "# calculate_weight(analytic_df)\n", "analytic_df.hvplot.line(x='time', y='cur_w', by='ticker', width=500, height=400)\n", "# analytic_d" ] }, { "cell_type": "code", "execution_count": 13, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
timetickeropenclosehighlowvolumemoneysharessectoraggregate_sectordisplay_namenamecashini_wave_pricecur_w
1112023-08-14000877.XSHE8.358.408.448.267357900.06.138507e+071100.0建筑材料I 水泥制造II 水泥制造III 非金属矿物制品业 水泥与混凝土 原材料原料与能源天山股份TSGF9240.00.007896NaN0.008144
1122023-08-15000877.XSHE8.428.428.458.306000000.05.030405e+071100.0建筑材料I 水泥制造II 水泥制造III 非金属矿物制品业 水泥与混凝土 原材料原料与能源天山股份TSGF9262.00.007896NaN0.008128
452023-08-14002202.XSHE10.7310.7910.8410.6111395130.01.222121e+081200.0电气设备I 风电设备II 风电整机III 通用设备制造业 风电设备 工业工业金风科技JFKJ12948.00.003677NaN0.011412
462023-08-15002202.XSHE10.8010.7010.8110.648332232.08.922860e+071200.0电气设备I 风电设备II 风电整机III 通用设备制造业 风电设备 工业工业金风科技JFKJ12840.00.003677NaN0.011267
892023-08-14002271.XSHE28.0228.6529.1327.5625064704.07.112971e+081200.0建筑材料I 其他建材II 防水材料III 非金属矿物制品业 建筑产品 工业原料与能源东方雨虹DFYH34380.00.025926NaN0.030301
902023-08-15002271.XSHE28.7528.9329.0028.1623813851.06.813863e+081200.0建筑材料I 其他建材II 防水材料III 非金属矿物制品业 建筑产品 工业原料与能源东方雨虹DFYH34716.00.025926NaN0.030464
12023-08-14300408.XSHE32.0031.9832.3831.814754694.01.522192e+08900.0电子I 元件II 被动元件III 计算机、通信和其他电子设备制造业 被动元件 信息技术信息与通信三环集团SHJT28782.00.017100NaN0.025367
22023-08-15300408.XSHE31.9031.7332.5031.337131360.02.259226e+08900.0电子I 元件II 被动元件III 计算机、通信和其他电子设备制造业 被动元件 信息技术信息与通信三环集团SHJT28557.00.017100NaN0.025060
1002023-08-14300413.XSHE32.5033.2733.3232.376601139.02.173793e+08400.0传媒I 数字媒体II 视频媒体III 文化艺术业 视频媒体 通信服务信息与通信芒果超媒MGCM13308.00.010379NaN0.011729
1012023-08-15300413.XSHE33.2732.2533.3032.0110558410.03.417554e+08400.0传媒I 数字媒体II 视频媒体III 文化艺术业 视频媒体 通信服务信息与通信芒果超媒MGCM12900.00.010379NaN0.011320
562023-08-14300759.XSHE28.9329.3429.4528.5522129995.06.413811e+08900.0医药生物I 医疗服务II 医疗研发外包III 研究和试验发展 制药与生物科技服务 医药卫生医药卫生康龙化成KLHC26406.00.031525NaN0.023273
572023-08-15300759.XSHE29.2629.0029.3528.3919712233.05.657508e+08900.0医药生物I 医疗服务II 医疗研发外包III 研究和试验发展 制药与生物科技服务 医药卫生医药卫生康龙化成KLHC26100.00.031525NaN0.022904
782023-08-14300979.XSHE51.9553.4053.4651.281051877.05.531820e+07400.0纺织服装I 纺织制造II 纺织鞋类制造III 皮革、毛皮、羽毛及其制品和制鞋业 鞋帽与配饰 ...消费华利集团HLJT21360.00.015049NaN0.018826
792023-08-15300979.XSHE53.3553.4953.8952.66750046.04.004042e+07400.0纺织服装I 纺织制造II 纺织鞋类制造III 皮革、毛皮、羽毛及其制品和制鞋业 鞋帽与配饰 ...消费华利集团HLJT21396.00.015049NaN0.018776
122023-08-14600600.XSHG95.0095.0095.3593.204552721.04.289787e+08400.0食品饮料I 非白酒II 啤酒III 酒、饮料和精制茶制造业 啤酒 主要消费消费青岛啤酒QDPJ38000.00.108818NaN0.033492
132023-08-15600600.XSHG95.0394.0495.3593.513148755.02.968795e+08400.0食品饮料I 非白酒II 啤酒III 酒、饮料和精制茶制造业 啤酒 主要消费消费青岛啤酒QDPJ37616.00.108818NaN0.033009
232023-08-14600809.XSHG222.00224.27224.68219.234829616.01.071456e+09700.0食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费消费山西汾酒SXFJ156989.00.119433NaN0.138363
242023-08-15600809.XSHG224.25224.00225.58221.003278697.07.323132e+08700.0食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费消费山西汾酒SXFJ156800.00.119433NaN0.137597
252023-08-16600809.XSHG222.60225.50227.59222.223892264.08.778281e+081000.0食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费消费山西汾酒SXFJ225500.00.250000NaN0.646502
262023-08-17600809.XSHG224.46229.72229.95223.284458965.01.013827e+091000.0食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费消费山西汾酒SXFJ229720.00.250000NaN0.648633
272023-08-18600809.XSHG229.78225.76232.10225.403357055.07.618667e+081000.0食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费消费山西汾酒SXFJ225760.00.250000NaN0.647192
282023-08-21600809.XSHG225.00226.85230.68221.004344149.09.884448e+081000.0食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费消费山西汾酒SXFJ226850.00.250000NaN0.653200
292023-08-22600809.XSHG227.39226.45228.20222.263972474.08.924032e+081000.0食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费消费山西汾酒SXFJ226450.00.250000NaN0.646206
672023-08-14601318.XSHG48.3048.5348.8248.2860472146.02.935327e+09400.0非银金融I 保险II 保险III 保险业 多元化保险 金融金融与地产中国平安ZGPA19412.00.119706NaN0.017109
682023-08-15601318.XSHG48.5248.6849.0848.0252183684.02.535572e+09400.0非银金融I 保险II 保险III 保险业 多元化保险 金融金融与地产中国平安ZGPA19472.00.119706NaN0.017087
692023-08-16601318.XSHG48.3248.3548.9448.1347660376.02.306796e+091000.0非银金融I 保险II 保险III 保险业 多元化保险 金融金融与地产中国平安ZGPA48350.00.250000NaN0.138618
702023-08-17601318.XSHG48.0147.9148.1847.3359827368.02.853723e+091000.0非银金融I 保险II 保险III 保险业 多元化保险 金融金融与地产中国平安ZGPA47910.00.250000NaN0.135278
712023-08-18601318.XSHG47.9047.5249.0047.5263666255.03.066294e+091000.0非银金融I 保险II 保险III 保险业 多元化保险 金融金融与地产中国平安ZGPA47520.00.250000NaN0.136227
722023-08-21601318.XSHG47.4046.6747.4946.6762808090.02.950143e+091000.0非银金融I 保险II 保险III 保险业 多元化保险 金融金融与地产中国平安ZGPA46670.00.250000NaN0.134383
732023-08-22601318.XSHG46.9047.0047.3046.4751849548.02.430767e+091000.0非银金融I 保险II 保险III 保险业 多元化保险 金融金融与地产中国平安ZGPA47000.00.250000NaN0.134121
342023-08-14603000.XSHG29.0032.1932.1928.8597674615.03.035976e+0923500.0传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务信息与通信人民网RMW756465.00.430369NaN0.666716
352023-08-15603000.XSHG32.8332.4633.5132.02107039840.03.509711e+0923500.0传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务信息与通信人民网RMW762810.00.430369NaN0.669389
362023-08-16603000.XSHG32.4632.4633.3330.9096472064.03.114885e+091000.0传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务信息与通信人民网RMW32460.00.250000NaN0.093062
372023-08-17603000.XSHG32.0433.8034.2231.83110222658.03.686636e+091000.0传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务信息与通信人民网RMW33800.00.250000NaN0.095437
382023-08-18603000.XSHG33.5034.2035.1532.80112988265.03.852462e+091000.0传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务信息与通信人民网RMW34200.00.250000NaN0.098042
392023-08-21603000.XSHG33.1633.1734.6632.1679040908.02.650834e+091000.0传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务信息与通信人民网RMW33170.00.250000NaN0.095511
402023-08-22603000.XSHG33.8736.4936.4933.77122393536.04.299076e+091000.0传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务信息与通信人民网RMW36490.00.250000NaN0.104129
1222023-08-14603288.XSHG43.5043.3143.7742.6317442281.07.536682e+08400.0食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费消费海天味业HTWY17324.00.110121NaN0.015269
1232023-08-15603288.XSHG43.6042.7343.6042.4010364699.04.437403e+08400.0食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费消费海天味业HTWY17092.00.110121NaN0.014999
1242023-08-16603288.XSHG42.4342.4942.9142.407427002.03.165294e+081000.0食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费消费海天味业HTWY42490.00.250000NaN0.121818
1252023-08-17603288.XSHG42.2042.7342.8341.7112749545.05.386939e+081000.0食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费消费海天味业HTWY42730.00.250000NaN0.120652
1262023-08-18603288.XSHG42.6541.3542.6541.2812081279.05.052964e+081000.0食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费消费海天味业HTWY41350.00.250000NaN0.118539
1272023-08-21603288.XSHG41.3540.6041.4740.6013034690.05.348660e+081000.0食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费消费海天味业HTWY40600.00.250000NaN0.116905
1282023-08-22603288.XSHG40.6540.4941.0739.9015421643.06.222933e+081000.0食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费消费海天味业HTWY40490.00.250000NaN0.115544
1292023-08-23603288.XSHG40.4939.8340.5339.8011035245.04.423327e+0810000.0食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费消费海天味业HTWY398300.01.000000NaN1.000000
1302023-08-24603288.XSHG39.9240.2840.5039.5212865543.05.163460e+0810000.0食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费消费海天味业HTWY402800.01.000000NaN1.000000
1312023-08-25603288.XSHG40.0840.0840.5539.918887682.03.573801e+0810000.0食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费消费海天味业HTWY400800.01.000000NaN1.000000
\n", "
" ], "text/plain": [ " time ticker open close high low volume \\\n", "111 2023-08-14 000877.XSHE 8.35 8.40 8.44 8.26 7357900.0 \n", "112 2023-08-15 000877.XSHE 8.42 8.42 8.45 8.30 6000000.0 \n", "45 2023-08-14 002202.XSHE 10.73 10.79 10.84 10.61 11395130.0 \n", "46 2023-08-15 002202.XSHE 10.80 10.70 10.81 10.64 8332232.0 \n", "89 2023-08-14 002271.XSHE 28.02 28.65 29.13 27.56 25064704.0 \n", "90 2023-08-15 002271.XSHE 28.75 28.93 29.00 28.16 23813851.0 \n", "1 2023-08-14 300408.XSHE 32.00 31.98 32.38 31.81 4754694.0 \n", "2 2023-08-15 300408.XSHE 31.90 31.73 32.50 31.33 7131360.0 \n", "100 2023-08-14 300413.XSHE 32.50 33.27 33.32 32.37 6601139.0 \n", "101 2023-08-15 300413.XSHE 33.27 32.25 33.30 32.01 10558410.0 \n", "56 2023-08-14 300759.XSHE 28.93 29.34 29.45 28.55 22129995.0 \n", "57 2023-08-15 300759.XSHE 29.26 29.00 29.35 28.39 19712233.0 \n", "78 2023-08-14 300979.XSHE 51.95 53.40 53.46 51.28 1051877.0 \n", "79 2023-08-15 300979.XSHE 53.35 53.49 53.89 52.66 750046.0 \n", "12 2023-08-14 600600.XSHG 95.00 95.00 95.35 93.20 4552721.0 \n", "13 2023-08-15 600600.XSHG 95.03 94.04 95.35 93.51 3148755.0 \n", "23 2023-08-14 600809.XSHG 222.00 224.27 224.68 219.23 4829616.0 \n", "24 2023-08-15 600809.XSHG 224.25 224.00 225.58 221.00 3278697.0 \n", "25 2023-08-16 600809.XSHG 222.60 225.50 227.59 222.22 3892264.0 \n", "26 2023-08-17 600809.XSHG 224.46 229.72 229.95 223.28 4458965.0 \n", "27 2023-08-18 600809.XSHG 229.78 225.76 232.10 225.40 3357055.0 \n", "28 2023-08-21 600809.XSHG 225.00 226.85 230.68 221.00 4344149.0 \n", "29 2023-08-22 600809.XSHG 227.39 226.45 228.20 222.26 3972474.0 \n", "67 2023-08-14 601318.XSHG 48.30 48.53 48.82 48.28 60472146.0 \n", "68 2023-08-15 601318.XSHG 48.52 48.68 49.08 48.02 52183684.0 \n", "69 2023-08-16 601318.XSHG 48.32 48.35 48.94 48.13 47660376.0 \n", "70 2023-08-17 601318.XSHG 48.01 47.91 48.18 47.33 59827368.0 \n", "71 2023-08-18 601318.XSHG 47.90 47.52 49.00 47.52 63666255.0 \n", "72 2023-08-21 601318.XSHG 47.40 46.67 47.49 46.67 62808090.0 \n", "73 2023-08-22 601318.XSHG 46.90 47.00 47.30 46.47 51849548.0 \n", "34 2023-08-14 603000.XSHG 29.00 32.19 32.19 28.85 97674615.0 \n", "35 2023-08-15 603000.XSHG 32.83 32.46 33.51 32.02 107039840.0 \n", "36 2023-08-16 603000.XSHG 32.46 32.46 33.33 30.90 96472064.0 \n", "37 2023-08-17 603000.XSHG 32.04 33.80 34.22 31.83 110222658.0 \n", "38 2023-08-18 603000.XSHG 33.50 34.20 35.15 32.80 112988265.0 \n", "39 2023-08-21 603000.XSHG 33.16 33.17 34.66 32.16 79040908.0 \n", "40 2023-08-22 603000.XSHG 33.87 36.49 36.49 33.77 122393536.0 \n", "122 2023-08-14 603288.XSHG 43.50 43.31 43.77 42.63 17442281.0 \n", "123 2023-08-15 603288.XSHG 43.60 42.73 43.60 42.40 10364699.0 \n", "124 2023-08-16 603288.XSHG 42.43 42.49 42.91 42.40 7427002.0 \n", "125 2023-08-17 603288.XSHG 42.20 42.73 42.83 41.71 12749545.0 \n", "126 2023-08-18 603288.XSHG 42.65 41.35 42.65 41.28 12081279.0 \n", "127 2023-08-21 603288.XSHG 41.35 40.60 41.47 40.60 13034690.0 \n", "128 2023-08-22 603288.XSHG 40.65 40.49 41.07 39.90 15421643.0 \n", "129 2023-08-23 603288.XSHG 40.49 39.83 40.53 39.80 11035245.0 \n", "130 2023-08-24 603288.XSHG 39.92 40.28 40.50 39.52 12865543.0 \n", "131 2023-08-25 603288.XSHG 40.08 40.08 40.55 39.91 8887682.0 \n", "\n", " money shares sector \\\n", "111 6.138507e+07 1100.0 建筑材料I 水泥制造II 水泥制造III 非金属矿物制品业 水泥与混凝土 原材料 \n", "112 5.030405e+07 1100.0 建筑材料I 水泥制造II 水泥制造III 非金属矿物制品业 水泥与混凝土 原材料 \n", "45 1.222121e+08 1200.0 电气设备I 风电设备II 风电整机III 通用设备制造业 风电设备 工业 \n", "46 8.922860e+07 1200.0 电气设备I 风电设备II 风电整机III 通用设备制造业 风电设备 工业 \n", "89 7.112971e+08 1200.0 建筑材料I 其他建材II 防水材料III 非金属矿物制品业 建筑产品 工业 \n", "90 6.813863e+08 1200.0 建筑材料I 其他建材II 防水材料III 非金属矿物制品业 建筑产品 工业 \n", "1 1.522192e+08 900.0 电子I 元件II 被动元件III 计算机、通信和其他电子设备制造业 被动元件 信息技术 \n", "2 2.259226e+08 900.0 电子I 元件II 被动元件III 计算机、通信和其他电子设备制造业 被动元件 信息技术 \n", "100 2.173793e+08 400.0 传媒I 数字媒体II 视频媒体III 文化艺术业 视频媒体 通信服务 \n", "101 3.417554e+08 400.0 传媒I 数字媒体II 视频媒体III 文化艺术业 视频媒体 通信服务 \n", "56 6.413811e+08 900.0 医药生物I 医疗服务II 医疗研发外包III 研究和试验发展 制药与生物科技服务 医药卫生 \n", "57 5.657508e+08 900.0 医药生物I 医疗服务II 医疗研发外包III 研究和试验发展 制药与生物科技服务 医药卫生 \n", "78 5.531820e+07 400.0 纺织服装I 纺织制造II 纺织鞋类制造III 皮革、毛皮、羽毛及其制品和制鞋业 鞋帽与配饰 ... \n", "79 4.004042e+07 400.0 纺织服装I 纺织制造II 纺织鞋类制造III 皮革、毛皮、羽毛及其制品和制鞋业 鞋帽与配饰 ... \n", "12 4.289787e+08 400.0 食品饮料I 非白酒II 啤酒III 酒、饮料和精制茶制造业 啤酒 主要消费 \n", "13 2.968795e+08 400.0 食品饮料I 非白酒II 啤酒III 酒、饮料和精制茶制造业 啤酒 主要消费 \n", "23 1.071456e+09 700.0 食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费 \n", "24 7.323132e+08 700.0 食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费 \n", "25 8.778281e+08 1000.0 食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费 \n", "26 1.013827e+09 1000.0 食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费 \n", "27 7.618667e+08 1000.0 食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费 \n", "28 9.884448e+08 1000.0 食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费 \n", "29 8.924032e+08 1000.0 食品饮料I 白酒II 白酒III 酒、饮料和精制茶制造业 白酒 主要消费 \n", "67 2.935327e+09 400.0 非银金融I 保险II 保险III 保险业 多元化保险 金融 \n", "68 2.535572e+09 400.0 非银金融I 保险II 保险III 保险业 多元化保险 金融 \n", "69 2.306796e+09 1000.0 非银金融I 保险II 保险III 保险业 多元化保险 金融 \n", "70 2.853723e+09 1000.0 非银金融I 保险II 保险III 保险业 多元化保险 金融 \n", "71 3.066294e+09 1000.0 非银金融I 保险II 保险III 保险业 多元化保险 金融 \n", "72 2.950143e+09 1000.0 非银金融I 保险II 保险III 保险业 多元化保险 金融 \n", "73 2.430767e+09 1000.0 非银金融I 保险II 保险III 保险业 多元化保险 金融 \n", "34 3.035976e+09 23500.0 传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务 \n", "35 3.509711e+09 23500.0 传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务 \n", "36 3.114885e+09 1000.0 传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务 \n", "37 3.686636e+09 1000.0 传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务 \n", "38 3.852462e+09 1000.0 传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务 \n", "39 2.650834e+09 1000.0 传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务 \n", "40 4.299076e+09 1000.0 传媒I 数字媒体II 门户网站III 互联网和相关服务 图文媒体 通信服务 \n", "122 7.536682e+08 400.0 食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费 \n", "123 4.437403e+08 400.0 食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费 \n", "124 3.165294e+08 1000.0 食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费 \n", "125 5.386939e+08 1000.0 食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费 \n", "126 5.052964e+08 1000.0 食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费 \n", "127 5.348660e+08 1000.0 食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费 \n", "128 6.222933e+08 1000.0 食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费 \n", "129 4.423327e+08 10000.0 食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费 \n", "130 5.163460e+08 10000.0 食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费 \n", "131 3.573801e+08 10000.0 食品饮料I 调味发酵品II 调味发酵品III 食品制造业 调味品与食用油 主要消费 \n", "\n", " aggregate_sector display_name name cash ini_w ave_price \\\n", "111 原料与能源 天山股份 TSGF 9240.0 0.007896 NaN \n", "112 原料与能源 天山股份 TSGF 9262.0 0.007896 NaN \n", "45 工业 金风科技 JFKJ 12948.0 0.003677 NaN \n", "46 工业 金风科技 JFKJ 12840.0 0.003677 NaN \n", "89 原料与能源 东方雨虹 DFYH 34380.0 0.025926 NaN \n", "90 原料与能源 东方雨虹 DFYH 34716.0 0.025926 NaN \n", "1 信息与通信 三环集团 SHJT 28782.0 0.017100 NaN \n", "2 信息与通信 三环集团 SHJT 28557.0 0.017100 NaN \n", "100 信息与通信 芒果超媒 MGCM 13308.0 0.010379 NaN \n", "101 信息与通信 芒果超媒 MGCM 12900.0 0.010379 NaN \n", "56 医药卫生 康龙化成 KLHC 26406.0 0.031525 NaN \n", "57 医药卫生 康龙化成 KLHC 26100.0 0.031525 NaN \n", "78 消费 华利集团 HLJT 21360.0 0.015049 NaN \n", "79 消费 华利集团 HLJT 21396.0 0.015049 NaN \n", "12 消费 青岛啤酒 QDPJ 38000.0 0.108818 NaN \n", "13 消费 青岛啤酒 QDPJ 37616.0 0.108818 NaN \n", "23 消费 山西汾酒 SXFJ 156989.0 0.119433 NaN \n", "24 消费 山西汾酒 SXFJ 156800.0 0.119433 NaN \n", "25 消费 山西汾酒 SXFJ 225500.0 0.250000 NaN \n", "26 消费 山西汾酒 SXFJ 229720.0 0.250000 NaN \n", "27 消费 山西汾酒 SXFJ 225760.0 0.250000 NaN \n", "28 消费 山西汾酒 SXFJ 226850.0 0.250000 NaN \n", "29 消费 山西汾酒 SXFJ 226450.0 0.250000 NaN \n", "67 金融与地产 中国平安 ZGPA 19412.0 0.119706 NaN \n", "68 金融与地产 中国平安 ZGPA 19472.0 0.119706 NaN \n", "69 金融与地产 中国平安 ZGPA 48350.0 0.250000 NaN \n", "70 金融与地产 中国平安 ZGPA 47910.0 0.250000 NaN \n", "71 金融与地产 中国平安 ZGPA 47520.0 0.250000 NaN \n", "72 金融与地产 中国平安 ZGPA 46670.0 0.250000 NaN \n", "73 金融与地产 中国平安 ZGPA 47000.0 0.250000 NaN \n", "34 信息与通信 人民网 RMW 756465.0 0.430369 NaN \n", "35 信息与通信 人民网 RMW 762810.0 0.430369 NaN \n", "36 信息与通信 人民网 RMW 32460.0 0.250000 NaN \n", "37 信息与通信 人民网 RMW 33800.0 0.250000 NaN \n", "38 信息与通信 人民网 RMW 34200.0 0.250000 NaN \n", "39 信息与通信 人民网 RMW 33170.0 0.250000 NaN \n", "40 信息与通信 人民网 RMW 36490.0 0.250000 NaN \n", "122 消费 海天味业 HTWY 17324.0 0.110121 NaN \n", "123 消费 海天味业 HTWY 17092.0 0.110121 NaN \n", "124 消费 海天味业 HTWY 42490.0 0.250000 NaN \n", "125 消费 海天味业 HTWY 42730.0 0.250000 NaN \n", "126 消费 海天味业 HTWY 41350.0 0.250000 NaN \n", "127 消费 海天味业 HTWY 40600.0 0.250000 NaN \n", "128 消费 海天味业 HTWY 40490.0 0.250000 NaN \n", "129 消费 海天味业 HTWY 398300.0 1.000000 NaN \n", "130 消费 海天味业 HTWY 402800.0 1.000000 NaN \n", "131 消费 海天味业 HTWY 400800.0 1.000000 NaN \n", "\n", " cur_w \n", "111 0.008144 \n", "112 0.008128 \n", "45 0.011412 \n", "46 0.011267 \n", "89 0.030301 \n", "90 0.030464 \n", "1 0.025367 \n", "2 0.025060 \n", "100 0.011729 \n", "101 0.011320 \n", "56 0.023273 \n", "57 0.022904 \n", "78 0.018826 \n", "79 0.018776 \n", "12 0.033492 \n", "13 0.033009 \n", "23 0.138363 \n", "24 0.137597 \n", "25 0.646502 \n", "26 0.648633 \n", "27 0.647192 \n", "28 0.653200 \n", "29 0.646206 \n", "67 0.017109 \n", "68 0.017087 \n", "69 0.138618 \n", "70 0.135278 \n", "71 0.136227 \n", "72 0.134383 \n", "73 0.134121 \n", "34 0.666716 \n", "35 0.669389 \n", "36 0.093062 \n", "37 0.095437 \n", "38 0.098042 \n", "39 0.095511 \n", "40 0.104129 \n", "122 0.015269 \n", "123 0.014999 \n", "124 0.121818 \n", "125 0.120652 \n", "126 0.118539 \n", "127 0.116905 \n", "128 0.115544 \n", "129 1.000000 \n", "130 1.000000 \n", "131 1.000000 " ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "analytic_df" ] } ], "metadata": { "kernelspec": { "display_name": "risk-dashboard", "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.11.4" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }