-
Notifications
You must be signed in to change notification settings - Fork 2
Jupyter Notebooks
BK Jackson edited this page Dec 23, 2024
·
24 revisions
Subpages:
- Optimizing Jupyter Notebooks
- Productionizing Jupyter Notebooks
- Jupyter Notebook nbconvert
- Notebook Innovation at Netflix
Writing Clean Jupyter Notebooks
#@title
from IPython.display import HTML
HTML('<iframe width="560" height="315" src="https://www.youtube.com/embed/tiZFewofSLM?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>')
%%HTML
<div align="center"><iframe src="<YOUR_FILENAME>.pptx" width="800px" height="500px" frameborder="0"></iframe></div>
%load README.md
Also
from IPython.display import display, Markdown
with open('README.md', 'r') as fh:
content = fh.read()
display(Markdown(content))
%%file -a ../src/utils.py
def my_appended_function(x):
print(x)
Note: %%file ../src/utils.py
will create a new file or overwrite an existing file.
At the command line:
$ jupyter nbextension list
Interactive Controls in Jupyter Notebooks - Covers ipywidgets
pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension
jupyter labextension install @jupyter-widgets/jupyterlab-manager
import ipywidgets as widgets
from ipywidgets import interact, interact_manual
@interact
def show_articles_more_than(column='claps', x=5000):
return df.loc[df[column] > x]
import os
from IPython.display import Image
@interact
def show_images(file=os.listdir('images/')):
display(Image(fdir+file))
Calculate correlation:
@interact
def correlations(column1=list(df.select_dtypes('number').columns),
column2=list(df.select_dtypes('number').columns)):
print(f"Correlation: {df[column1].corr(df[column2])}")
RISE Docs - With RISE, a Jupyter notebook extension, you can instantly turn your jupyter notebook into a live reveal.js-based presentation.
Awesome Jupyter - A curated list of awesome Jupyter projects, libraries and resources.
QGrid - An interactive grid for sorting, filtering, and editing DataFrames in Jupyter notebooks