Try using Jupyter Notebook dynamically

Current environment

RISE

--From before using live_reveal Dynamic HTML could be generated, but recently a project called RISE looks good. --I couldn't build the environment for some reason when ipython 3.x + live_reveal, but this time I entered quickly.

git clone https://github.com/damianavila/RISE
cd RISE
python setup.py install

--This will add a slideshow button to localhost jupyter --You can make a presentation with dynamic HTML, and even the code inside can be rewritten. ――I wrote up to that point and noticed that there was already a wonderful Qiita article.

pivottablejs [Reference URL](http://esu-ko.hatenablog.com/entry/2016/03/04/Python%E3%81%A7%E6%8E%A2%E7%B4%A2%E7%9A%84 % E3% 83% 87% E3% 83% BC% E3% 82% BF% E5% 88% 86% E6% 9E% 90% E3% 81% 97% E3% 81% 9F% E3% 81% 84% E3 % 81% AE% E3% 81% A7pivottablejs% E3% 82% 92% E4% BD% BF% E3% 81% 86)

conda install pivottablejs

--You can extend the graph drawing of pandas to dynamically switch from the table to the scatter plot and change the axis of the scatter plot. pvjs.png

ipywidgets.interact --There is also a wonderful Qiita article. --In Jupyter 4.x, IPython.html.widgets has been deprecated and is now ipywidgets. --Installation

conda install ipywidgets

Screenshot 2016-03-01 at 13.20.30.png

Passing a function and parameters to interact will generate a widget that will change the parameters. Screenshot 2016-03-01 at 13.22.01.png

You can also use interact as a function decorator, This method is also quite smart.

Screenshot 2016-03-01 at 13.26.30.png

bokeh --Although the version is updated frequently and the API is not stable, you can scale the visualization called bokeh. There is a library. -Reference --If you let interect specify the parameters and draw with bokeh, you will feel like you are using spotfire or tableau.

conda install bokeh

Example of use

from sklearn.datasets import load_breast_cancer
import pandas as pd
cancer=load_breast_cancer()
data=pd.DataFrame(cancer.data,columns=cancer.feature_names)
data["target"]=[cancer.target_names[i] for i in cancer.target]
def interactivebokeh(x_axis,y_axis):
    fig=bplt.figure(plot_width=640, plot_height=320)
    fig.circle(
                data[data.target=="malignant"][x_axis],
                data[data.target=="malignant"][y_axis],
                line_color="red",fill_color="red"
                )
    fig.square(
                data[data.target=="benign"][x_axis],
                data[data.target=="benign"][y_axis],
                line_color="blue",fill_color="blue"
                )
    bplt.show(fig)

Screenshot 2016-03-01 at 14.02.40.png

Recommended Posts

Try using Jupyter Notebook dynamically
Try using conda virtual environment with Jupyter Notebook
Try using Jupyter Notebook of Azure Machine Learning
Try running Jupyter Notebook on Mac
Somehow I tried using jupyter notebook
Try starting Jupyter Notebook ~ Esper training
Try using Tkinter
Jupyter Notebook memo
Introducing Jupyter Notebook
Try using docker-py
Try using cookiecutter
Try using PDFMiner
Try SVM with scikit-learn on Jupyter Notebook
Powerful Jupyter Notebook
Try using geopandas
Try using Selenium
Try using scipy
Try using pandas.DataFrame
Jupyter notebook password
Jupyter Notebook memo
Try using django-swiftbrowser
Try using matplotlib
Try using tf.metrics
Try using PyODE
Try a state-space model (Jupyter Notebook + IR kernel)
[Pythonocc] I tried using CAD on jupyter notebook
Settings when using Jupyter Notebook under Proxy server
Proxy settings when using pip or Jupyter Notebook
Try Apache Spark on Jupyter Notebook (on local Docker
Get started Jupyter Notebook
Try using virtualenv (virtualenvwrapper)
[Azure] Try using Azure Functions
Try using virtualenv now
Try using W & B
3 Jupyter notebook (Python) tricks
Try using Django templates.html
[Kaggle] Try using LGBM
Try using Python's feedparser.
Try using Python's Tkinter
I tried using Jupyter
Try using Tweepy [Python2.7]
Try using Pytorch's collate_fn
[Cloud103] # 3 Jupyter Notebook again
Try basic operations for Pandas DataFrame on Jupyter Notebook
Try using PythonTex with Texpad.
Introduced Jupyter Notebook to CentOS 7
[Python] Try using Tkinter's canvas
Try using Jupyter's Docker image
Try function optimization using Hyperopt
Display HTML in Jupyter notebook
Try using matplotlib with PyCharm
Try using Azure Logic Apps
Try using Kubernetes Client -Python-
[Kaggle] Try using xg boost
Try using the Twitter API
[Super Basics] About jupyter Notebook
High charts on Jupyter notebook
View PDF on Jupyter Notebook
Use Cython with Jupyter Notebook
Try using AWS SageMaker Studio
homebrew, pyenv, anaconda, Jupyter Notebook