{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
NEURON's h.topology() function displays the topological structure of the entire model, indicating which sections are connected to which sections, where they are connected, and how many segments each section is divided into.
\n", "If you're following along with our example, there's not much to see yet since there is only one section, but it does demonstrate that the soma has been created and has one segment (one dash is shown):
" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "|-| soma(0-1)\n", "\n" ] }, { "data": { "text/plain": [ "1.0" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "h.topology()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The h.topology() function displays its data to screen and returns 1.0 indicating success (this function always succeeds). Note: This function is only for displaying data; other methods must be used to store the data in a variable for programmatic analysis." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Every NEURON section has a psection method (think: properties of the section) that returns a Python dictionary providing a structured data representation of the properties of the section.
For example, we can query the soma via:
" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'point_processes': {},\n", " 'density_mechs': {},\n", " 'ions': {},\n", " 'morphology': {'L': 100.0,\n", " 'diam': [500.0],\n", " 'pts3d': [],\n", " 'parent': None,\n", " 'trueparent': None},\n", " 'nseg': 1,\n", " 'Ra': 35.4,\n", " 'cm': [1.0],\n", " 'regions': set(),\n", " 'species': set(),\n", " 'name': 'soma',\n", " 'hoc_internal_name': '__nrnsec_0x7fd768620000',\n", " 'cell': None}" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "soma.psection()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The results tell us the soma is a cylinder with length 100 microns, diameter 500 microns, axial resistivity 35.4 ohm*cm, and specific membrance capacitance 1 μF/cm2." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note: calling this method does not itself print anything to the screen. Instead it returns a dictionary. We see the contents of the dictionary only because we are running interactively; from a script, nothing would be printed unless we explicitly printed it with print, or, better pretty-printed it with pprint.pprint." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Since this is a dictionary, we can extract any properties we want using square brackets. For example, the length of the section is:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "100.0" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "soma.psection()['morphology']['L']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All of these values can be individually accessed in more efficient ways, but psection provides an overview of the full properties of the section." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For example, the length of the soma is more efficiently available (and settable) via:" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "100.0" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "soma.L" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "soma.psection()['morphology']['diam'] is a list (of length 1 here), with each entry corresponding to the value for each segment. Similarly for soma.psection()['cm'], etc." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Important: You may have noticed that the default diameter is 500 μm, which is excessively large for mammalian neurons. It's the default because it's appropriate for the squid giant axons studied by Hodgkin and Huxley. NEURON also uses squid-relevant values for axial resistivity (soma.Ra) and temperature (h.celsius). These should all be adjusted for mammalian models." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "dir()
function. Let’s see what it says about soma."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['L',\n",
" 'Ra',\n",
" '__call__',\n",
" '__class__',\n",
" '__delattr__',\n",
" '__dir__',\n",
" '__doc__',\n",
" '__eq__',\n",
" '__format__',\n",
" '__ge__',\n",
" '__getattribute__',\n",
" '__gt__',\n",
" '__hash__',\n",
" '__init__',\n",
" '__init_subclass__',\n",
" '__iter__',\n",
" '__le__',\n",
" '__lt__',\n",
" '__module__',\n",
" '__ne__',\n",
" '__new__',\n",
" '__reduce__',\n",
" '__reduce_ex__',\n",
" '__repr__',\n",
" '__setattr__',\n",
" '__sizeof__',\n",
" '__str__',\n",
" '__subclasshook__',\n",
" 'allseg',\n",
" 'arc3d',\n",
" 'cell',\n",
" 'children',\n",
" 'connect',\n",
" 'diam3d',\n",
" 'has_membrane',\n",
" 'hname',\n",
" 'hoc_internal_name',\n",
" 'insert',\n",
" 'is_pysec',\n",
" 'n3d',\n",
" 'name',\n",
" 'nseg',\n",
" 'orientation',\n",
" 'parentseg',\n",
" 'psection',\n",
" 'pt3dadd',\n",
" 'pt3dchange',\n",
" 'pt3dclear',\n",
" 'pt3dinsert',\n",
" 'pt3dremove',\n",
" 'pt3dstyle',\n",
" 'push',\n",
" 'rallbranch',\n",
" 'same',\n",
" 'spine3d',\n",
" 'subtree',\n",
" 'trueparentseg',\n",
" 'uninsert',\n",
" 'wholetree',\n",
" 'x3d',\n",
" 'y3d',\n",
" 'z3d']"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dir(soma)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This tells us all of the Python methods and variables associated with the object. Any methods with two leading and trailing underscores are reserved by Python. The other items in the list are additional members of soma that we can call. To see all of the functions, variables, etc available through NEURON's h submodule, try:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"APCount, AlphaSynapse, BBSaveState, CVode, DEG, Deck, E, Exp2Syn,\n",
"ExpSyn, FARADAY, FInitializeHandler, File, GAMMA, GUIMath, Glyph,\n",
"Graph, HBox, IClamp, Impedance, IntFire1, IntFire2, IntFire4, KSChan,\n",
"KSGate, KSState, KSTrans, L, LinearMechanism, List, Matrix,\n",
"MechanismStandard, MechanismType, NetCon, NetStim, OClamp, PHI, PI,\n",
"PPShape, PWManager, ParallelContext, PatternStim, PlotShape,\n",
"PointProcessMark, Pointer, PtrVector, PythonObject, R, Ra, Random,\n",
"RangeVarPlot, SEClamp, SaveState, Section, SectionBrowser,\n",
"SectionList, SectionRef, Shape, SingleChan, StateTransitionEvent,\n",
"StringFunctions, SymChooser, TQueue, TextEditor, Timer, VBox, VClamp,\n",
"ValueFieldEditor, Vector, __abs__, __add__, __bool__, __call__,\n",
"__class__, __delattr__, __delitem__, __dir__, __doc__, __eq__,\n",
"__format__, __ge__, __getattribute__, __getitem__, __gt__, __hash__,\n",
"__init__, __init_subclass__, __iter__, __le__, __len__, __lt__,\n",
"__module__, __mul__, __ne__, __neg__, __new__, __next__, __pos__,\n",
"__radd__, __reduce__, __reduce_ex__, __repr__, __rmul__, __rsub__,\n",
"__rtruediv__, __setattr__, __setitem__, __setstate__, __sizeof__,\n",
"__str__, __sub__, __subclasshook__, __truediv__, _pysec, abs, access,\n",
"allobjects, allobjectvars, allsec, arc3d, area, argtype, atan, atan2,\n",
"attr_praxis, axis, baseattr, batch_run, batch_save, begintemplate,\n",
"boolean_dialog, break, capacitance, cas, celsius, chdir, checkpoint,\n",
"clamp_resist, cm, connect, continue, continue_dialog,\n",
"coredump_on_error, cos, create, debug, default_dll_loaded_,\n",
"define_shape, delete, delete_section, depvar, diam, diam3d,\n",
"diam_changed, dik_dv_, dina_dv_, disconnect, distance, doEvents,\n",
"doNotify, double, dt, e_extracellular, e_fastpas, e_pas, ek, el_hh,\n",
"else, em, ena, endtemplate, eps_IntFire4, eqinit, eqn, erf, erfc,\n",
"execerror, execute, execute1, exp, external, extracellular, fadvance,\n",
"fastpas, fclamp, fclampi, fclampv, fcurrent, finitialize, fit_praxis,\n",
"float_epsilon, fmatrix, fmenu, for, forall, forsec, fprint,\n",
"frecord_init, fscan, fstim, fstimi, fsyn, fsyng, fsyni, func,\n",
"g_fastpas, g_pas, getSpineArea, getcwd, getstr, ghk, gk_hh, gkbar_hh,\n",
"gl_hh, gna_hh, gnabar_hh, graph, graphmode, h_hh, help, hh, hinf_hh,\n",
"hname, hoc_ac_, hoc_cross_x_, hoc_cross_y_, hoc_obj_, hoc_pointer_,\n",
"hoc_stdout, hocobjptr, htau_hh, i_cap, i_membrane, i_membrane_, i_pas,\n",
"ib_IntFire4, if, ifsec, ik, il_hh, ina, initnrn, insert,\n",
"install_vector_fitness, int, ion_charge, ion_register, ion_style,\n",
"ismembrane, issection, iterator, iterator_statement, ivoc_style,\n",
"k_ion, keep_nseg_parm, ki, ki0_k_ion, ko, ko0_k_ion, load_file,\n",
"load_func, load_java, load_proc, load_template, local, localobj, log,\n",
"log10, lw, m_hh, machine_name, make_mechanism, make_pointprocess,\n",
"mcell_ran4, mcell_ran4_init, minf_hh, morphology, mtau_hh, n3d, n_hh,\n",
"na_ion, nai, nai0_na_ion, name_declared, nao, nao0_na_ion, nernst,\n",
"neuronhome, new, ninf_hh, node_data, nrn_feenableexcept, nrn_load_dll,\n",
"nrn_mallinfo, nrn_netrec_state_adjust, nrn_shape_changed_,\n",
"nrnallpointmenu, nrnallsectionmenu, nrnglobalmechmenu,\n",
"nrniv_bind_thread, nrnmechmenu, nrnmpi_init, nrnpointmenu, nrnpython,\n",
"nrnsecmenu, nrnversion, nseg, ntau_hh, numarg, obfunc, object_id,\n",
"object_pop, object_push, object_pushed, objectvar, objref, parallel,\n",
"parent_connection, parent_node, parent_section, pas, plot, plotx,\n",
"ploty, plt, pop_section, print, print_session, printf, prmat, proc,\n",
"prstim, psection, pt3dadd, pt3dchange, pt3dclear, pt3dconst,\n",
"pt3dinsert, pt3dremove, pt3dstyle, public, push_section, pval_praxis,\n",
"pwman_place, quit, rallbranch, rates_hh, read, ref, regraph,\n",
"retrieveaudit, return, ri, ropen, same, save_session, saveaudit,\n",
"secname, secondorder, section_exists, section_orientation,\n",
"section_owner, sectionname, setSpineArea, setcolor, setdata_feature,\n",
"setdata_hh, setdata_pas, setpointer, show_errmess_always, show_winio,\n",
"sin, solve, spine3d, sprint, sqrt, sred, sscanf, startsw, stop,\n",
"stop_praxis, stoprun, stopsw, strcmp, strdef, string_dialog, symbols,\n",
"system, t, tanh, taueps_IntFire4, this_node, this_section, topology,\n",
"uninsert, units, unix_mac_pc, use_mcell_ran4, usetable_hh, v,\n",
"variable_domain, vext, vtrap_hh, while, wopen, x3d, xbutton, xc,\n",
"xcheckbox, xfixedvalue, xg, xlabel, xmenu, xopen, xopen_broadcast_,\n",
"xpanel, xpvalue, xradiobutton, xraxial, xred, xslider, xstatebutton,\n",
"xvalue, xvarlabel, y3d, z3d\n"
]
}
],
"source": [
"import textwrap\n",
"print(textwrap.fill(', '.join(dir(h))))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(The ', '.join(...) tells Python to build a string out of the list returned by dir where the items are separated from each other with a comma and a space. The textwrap.fill(...) tells Python to split long lines into multiple lines, by default a maximum of 70 characters long.)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"dir()
, help from docstrings is available using help()
."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For example, from dir(soma) above, we know that there is a connect method available. Let's inquire about that:"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on built-in function connect:\n",
"\n",
"connect(...) method of nrn.Section instance\n",
" childSection.connect(parentSection, [parentX], [childEnd]) or\n",
" childSection.connect(parentSegment, [childEnd])\n",
"\n"
]
}
],
"source": [
"help(soma.connect)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"When running interactively in Jupyter, the same information is available in a window that can be popped out by prefacing the method/function/etc with a question mark; e.g."
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"?soma.connect"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"pas | \n", "Passive (“leak”) channel. | \n", "
extracellular | \n", "For simulating effects of nonzero extracellular\n", "potential, as may happen with leaky patch clamps,\n", "or detailed propertes of the myelin sheath. | \n", "
hh | \n", "Hodgkin-Huxley sodium, potassium, and leakage channels. | \n", "
IClamp
object) into the center of the soma to induce some membrane dynamics."
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"iclamp = h.IClamp(soma(0.5))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"An IClamp is a Point Process. Point processes are point sources of current. When making a new PointProcess, you pass the segment to which it will bind.\n",
"\n",
"Again, with the dir function, we can validate that iclamp is an object and contains some useful parameters. Let's look at some of those parameters. We use a list comprehension to ignore those elements of the dir that start with double underscores (and are thus Python magic methods and not functions/variables intended to be used directly). "
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['amp', 'baseattr', 'delay', 'dur', 'get_loc', 'get_segment', 'has_loc', 'hname', 'hocobjptr', 'i', 'loc', 'same']\n"
]
}
],
"source": [
"print([item for item in dir(iclamp) if not item.startswith('__')])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In particular, we notice three key properties of a current clamp: amp -- the amplitude (in nA), delay -- the time the current clamp switches on (in ms), and dur -- how long (in ms) the current clamp stays on. Let's set these values:"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
"iclamp.delay = 2\n",
"iclamp.dur = 0.1\n",
"iclamp.amp = 0.9"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's use psection to get a representation of the soma model:"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'point_processes': {'IClamp': {IClamp[0]}},\n",
" 'density_mechs': {'hh': {'gnabar': [0.12],\n",
" 'gkbar': [0.036],\n",
" 'gl': [0.0003],\n",
" 'el': [-54.3],\n",
" 'gna': [0.0],\n",
" 'gk': [0.0],\n",
" 'il': [0.0],\n",
" 'm': [0.0],\n",
" 'h': [0.0],\n",
" 'n': [0.0]}},\n",
" 'ions': {'na': {'ena': [50.0],\n",
" 'nai': [10.0],\n",
" 'nao': [140.0],\n",
" 'ina': [0.0],\n",
" 'dina_dv_': [0.0]},\n",
" 'k': {'ek': [-77.0],\n",
" 'ki': [54.4],\n",
" 'ko': [2.5],\n",
" 'ik': [0.0],\n",
" 'dik_dv_': [0.0]}},\n",
" 'morphology': {'L': 20.0,\n",
" 'diam': [20.0],\n",
" 'pts3d': [],\n",
" 'parent': None,\n",
" 'trueparent': None},\n",
" 'nseg': 1,\n",
" 'Ra': 35.4,\n",
" 'cm': [1.0],\n",
" 'regions': set(),\n",
" 'species': set(),\n",
" 'name': 'soma',\n",
" 'hoc_internal_name': '__nrnsec_0x7fd768620000',\n",
" 'cell': None}"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"soma.psection()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"When working in Jupyter with an active internet connection, it is often convenient to use the bokeh module for plotting, as it provides interactive graphs that can be panned, zoomed, and saved from the Jupyter notebook.
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's load bokeh and tell it to output to the Jupyter notebook:" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " var JS_MIME_TYPE = 'application/javascript';\n", " var HTML_MIME_TYPE = 'text/html';\n", " var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n", " var CLASS_NAME = 'output_bokeh rendered_html';\n", "\n", " /**\n", " * Render data to the DOM node\n", " */\n", " function render(props, node) {\n", " var script = document.createElement(\"script\");\n", " node.appendChild(script);\n", " }\n", "\n", " /**\n", " * Handle when an output is cleared or removed\n", " */\n", " function handleClearOutput(event, handle) {\n", " var cell = handle.cell;\n", "\n", " var id = cell.output_area._bokeh_element_id;\n", " var server_id = cell.output_area._bokeh_server_id;\n", " // Clean up Bokeh references\n", " if (id != null && id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", "\n", " if (server_id !== undefined) {\n", " // Clean up Bokeh references\n", " var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n", " cell.notebook.kernel.execute(cmd, {\n", " iopub: {\n", " output: function(msg) {\n", " var id = msg.content.text.trim();\n", " if (id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", " }\n", " }\n", " });\n", " // Destroy server and session\n", " var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n", " cell.notebook.kernel.execute(cmd);\n", " }\n", " }\n", "\n", " /**\n", " * Handle when a new output is added\n", " */\n", " function handleAddOutput(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", "\n", " // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n", " if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", "\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", "\n", " if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n", " toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n", " // store reference to embed id on output_area\n", " output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " }\n", " 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].firstChild.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", " function register_renderer(events, OutputArea) {\n", "\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[toinsert.length - 1]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " /* Handle when an output is cleared or removed */\n", " events.on('clear_output.CodeCell', handleClearOutput);\n", " events.on('delete.Cell', handleClearOutput);\n", "\n", " /* Handle when a new output is added */\n", " events.on('output_added.OutputArea', handleAddOutput);\n", "\n", " /**\n", " * Register the mime type and append_mime function with output_area\n", " */\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " /* Is output safe? */\n", " safe: true,\n", " /* Index of renderer in `output_area.display_order` */\n", " index: 0\n", " });\n", " }\n", "\n", " // register the mime type if in Jupyter Notebook environment and previously unregistered\n", " if (root.Jupyter !== undefined) {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", "\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " }\n", "\n", " \n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " var NB_LOAD_WARNING = {'data': {'text/html':\n", " \"\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"
\\n\"+\n", " \"\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"
\\n\"+\n",
" \"\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"
\\n\"+\n \"