I’ve been searching all over but have yet to find a solution for my simple problem. Using the getting started example in a classic jupyter notebook will display the sliders and plot but will not update the figure with slider changes. I’ve tried a few of the other examples for param watching and the Google Map Viewer with no luck. Again, widgets show but not updates or callback. I am running an environment, details below, and think the issue may reside there.
Thank you in advance for help.
Here is my code:
import pandas as pd; import numpy as np; import matplotlib.pyplot as plt
data = pd.read_csv('datatraining.csv')
data['date'] = data.date.astype('datetime64[ns]')
data = data.set_index('date')
data.tail()
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvas
%matplotlib inline
def mpl_plot(avg, highlight):
fig = Figure()
FigureCanvas(fig) # not needed in mpl >= 3.1
ax = fig.add_subplot()
avg.plot(ax=ax)
if len(highlight): highlight.plot(style='o', ax=ax)
return fig
def find_outliers(variable='Temperature', window=30, sigma=10, view_fn=mpl_plot):
avg = data[variable].rolling(window=window).mean()
residual = data[variable] - avg
std = residual.rolling(window=window).std()
outliers = (np.abs(residual) > std * sigma)
return view_fn(avg, avg[outliers])
import panel as pn
pn.extension()
pn.interact(find_outliers)
Here is my environment list:
channels:
- pyviz
- conda-forge
- defaults
dependencies:
- attrs=19.3.0=py_0
- backcall=0.1.0=py_0
- blas=1.0=mkl
- bleach=3.1.5=pyh9f0ad1d_0
- bokeh=2.1.0=py37hc8dfbb8_0
- brotlipy=0.7.0=py37h4ab8f01_1000
- ca-certificates=2020.4.5.2=hecda079_0
- certifi=2020.4.5.2=py37hc8dfbb8_0
- cffi=1.14.0=py37ha419a9e_0
- chardet=3.0.4=py37hc8dfbb8_1006
- colorama=0.4.3=py_0
- cryptography=2.9.2=py37h26f1ce3_0
- cycler=0.10.0=py_2
- decorator=4.4.2=py_0
- defusedxml=0.6.0=py_0
- entrypoints=0.3=py37hc8dfbb8_1001
- freetype=2.10.2=hd328e21_0
- icc_rt=2019.0.0=h0cc432a_1
- icu=64.2=he025d50_1
- idna=2.9=py_1
- importlib-metadata=1.6.1=py37hc8dfbb8_0
- importlib_metadata=1.6.1=0
- intel-openmp=2019.4=245
- ipykernel=5.3.0=py37h5ca1d4c_0
- ipython=7.15.0=py37hc8dfbb8_0
- ipython_genutils=0.2.0=py_1
- ipywidgets=7.5.1=py_0
- jedi=0.17.0=py37hc8dfbb8_0
- jinja2=2.11.2=pyh9f0ad1d_0
- joblib=0.15.1=py_0
- jpeg=9d=he774522_0
- json5=0.9.0=py_0
- jsonschema=3.2.0=py37hc8dfbb8_1
- jupyter_client=6.1.3=py_0
- jupyter_core=4.6.3=py37hc8dfbb8_1
- jupyterlab=2.1.4=py_1
- jupyterlab_server=1.1.5=py_0
- kiwisolver=1.2.0=py37heaa310e_0
- libblas=3.8.0=14_mkl
- libcblas=3.8.0=14_mkl
- libclang=9.0.1=default_hf44288c_0
- liblapack=3.8.0=14_mkl
- libpng=1.6.37=hfe6a214_1
- libsodium=1.0.17=h2fa13f4_0
- libtiff=4.1.0=h885aae3_6
- lz4-c=1.9.2=h62dcd97_1
- m2w64-gcc-libgfortran=5.3.0=6
- m2w64-gcc-libs=5.3.0=7
- m2w64-gcc-libs-core=5.3.0=7
- m2w64-gmp=6.1.0=2
- m2w64-libwinpthread-git=5.0.0.4634.697f757=2
- markdown=3.2.2=py_0
- markupsafe=1.1.1=py37h8055547_1
- matplotlib=3.2.1=0
- matplotlib-base=3.2.1=py37h911224e_0
- mistune=0.8.4=py37h8055547_1001
- mkl=2019.4=245
- mkl-service=2.3.0=py37hfa6e2cd_0
- msys2-conda-epoch=20160418=1
- nbconvert=5.6.1=py37hc8dfbb8_1
- nbformat=5.0.6=py_0
- notebook=6.0.3=py37hc8dfbb8_0
- numpy=1.18.5=py37hae9e721_0
- olefile=0.46=py_0
- openssl=1.1.1g=he774522_0
- packaging=20.4=pyh9f0ad1d_0
- pandas=1.0.4=py37h3bbf574_0
- pandoc=2.9.2.1=0
- pandocfilters=1.4.2=py_1
- panel=0.9.5=py_0
- param=1.9.3=py_0
- parso=0.7.0=pyh9f0ad1d_0
- patsy=0.5.1=py_0
- pickleshare=0.7.5=py37hc8dfbb8_1001
- pillow=7.1.2=py37hc826c6e_0
- pip=20.1.1=py_1
- prometheus_client=0.8.0=pyh9f0ad1d_0
- prompt-toolkit=3.0.5=py_0
- pycparser=2.20=py_0
- pyct=0.4.6=py_0
- pyct-core=0.4.6=py_0
- pygments=2.6.1=py_0
- pyopenssl=19.1.0=py_1
- pyparsing=2.4.7=pyh9f0ad1d_0
- pyqt=5.12.3=py37h1834ac0_3
- pyrsistent=0.16.0=py37h8055547_0
- pysocks=1.7.1=py37hc8dfbb8_1
- python=3.7.6=cpython_h60c2a47_6
- python-dateutil=2.8.1=py_0
- python_abi=3.7=1_cp37m
- pytz=2020.1=pyh9f0ad1d_0
- pyviz_comms=0.7.5=py_0
- pywin32=227=py37hfa6e2cd_0
- pywinpty=0.5.7=py37_0
- pyyaml=5.3.1=py37h8055547_0
- pyzmq=19.0.1=py37h453f00a_0
- qt=5.12.5=h7ef1ec2_0
- requests=2.23.0=pyh8c360ce_2
- scikit-learn=0.23.1=py37ha0ab79d_0
- scipy=1.3.1=py37h29ff71c_0
- seaborn=0.10.1=py_0
- send2trash=1.5.0=py_0
- setuptools=47.1.1=py37hc8dfbb8_0
- six=1.15.0=pyh9f0ad1d_0
- sqlite=3.30.1=hfa6e2cd_0
- statsmodels=0.11.1=py37h8055547_1
- terminado=0.8.3=py37hc8dfbb8_1
- testpath=0.4.4=py_0
- threadpoolctl=2.1.0=pyh5ca1d4c_0
- tk=8.6.10=hfa6e2cd_0
- tornado=6.0.4=py37hfa6e2cd_0
- tqdm=4.46.1=pyh9f0ad1d_0
- traitlets=4.3.3=py37hc8dfbb8_1
- typing_extensions=3.7.4.2=py_0
- urllib3=1.25.9=py_0
- vc=14.1=h869be7e_1
- vs2015_runtime=14.16.27012=h30e32a0_2
- wcwidth=0.2.3=pyh9f0ad1d_0
- webencodings=0.5.1=py_1
- wheel=0.34.2=py_1
- widgetsnbextension=3.5.1=py37_0
- win_inet_pton=1.1.0=py37_0
- wincertstore=0.2=py37_1003
- winpty=0.4.3=4
- xlrd=1.2.0=py_0
- xz=5.2.5=h2fa13f4_0
- yaml=0.2.5=he774522_0
- zeromq=4.3.2=h6538335_2
- zipp=3.1.0=py_0
- zlib=1.2.11=h2fa13f4_1006
- zstd=1.4.4=h9f78265_3
- pip:
- pyqt5-sip==4.19.18
- pyqtchart==5.12
- pyqtwebengine==5.12.1