This is a repository of my notes
pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
pip install jupyter contrib_nbextensions
pip install autopep8
pip install npm
pip install nodejs
jupyter contrib nbextension install --user
Read below for more useful tools for data-science https://towardsdatascience.com/bringing-the-best-out-of-jupyter-notebooks-for-data-science-f0871519ca29
pip install qgrid
jupyter nbextension enable --py --sys-prefix qgrid
#Note that http urls will not be displayed. Only https are allowed inside the Iframe
from IPython.display import IFrame
IFrame('https://en.wikipedia.org/wiki/HTTPS', width=800, heigh
6B72
t=450)
from IPython.display import IFrame
IFrame('https://arxiv.org/pdf/1406.2661.pdf', width=800, height=450)
pip freeze > requirements.txt
You will then find the requirements.txt file in your current working directory
Then install:
pip install -r requirements.txt
Ignore errors when installing packages via requirements.txt
FOR /F %p IN (requirements.txt) DO pip install %p
https://stackoverflow.com/questions/6457794/pip-install-r-continue-past-installs-that-fail
For Conda install, you can use
$ FOR /F "delims=~" %f in (requirements.txt) DO conda install --yes "%f" || pip install "%f"
Exporting Jupyter notebook in HTML
- Run Jupyter notebook and download the notebook in the browser: File->Download as->HTML and you will get a html page with code and output.
- Open the exported HTML with browser and activate the browser console with key F12
- Run following command in the console:
document.querySelectorAll("div.input").forEach(function(a){a.remove()})
- The code removes all input div DOM. Then right mouse button and chose "Save Page As" and Save the "Complete page" (not single page).
- You will get a page with an associated folder in windows. Use a trick by zip the html page and then extract to unbind the associated. The folder is useless.
- Now it is a single html page without code. You can re-distribute it or print it as PDF.
How do you show GIFs in an IPYNB HTML export?
- Run this into the cell
HTML('<IMG SRC="thegif.gif">')
, where "thegif.gif" is your gif's file name - Download your Export into HTML, create a new folder, put the HTML and GIF file in together.
- Create a zip file from the folder and attach it to an email.
- Send it over in an email to Person Bob.
- Bob opens the zip file and drags the folder out to the desktop.
- Open the folder that Bob has dragged into the desktop then open your HTML. PS - HTML only works in Chromium browsers.
How do you show Plotly plots in an IPYNB HTML?
- Run your code and have the plot displayed in your .ipynb file
- Create a new folder, then download your Export into HTML to that new folder. You will see a new folder created within that folder called "nameofyourfile_files", it has all of the files that you need like your jquery, MathJax, etc..
- Create a zip file from the folder and attach it to an email.
- Send it over in an email to Person Bob.
- Bob opens the zip file and drags the folder out to the desktop.
- Open the folder that Bob has dragged into the desktop then open your HTML. PS - HTML only works in Chromium browsers.