how to open Jupyter notebook in chrome on windows

If you haven’t already, create a notebook config file by running jupyter notebook –generate-config Then, edit the file jupyter_notebook_config.py found in the .jupyter folder of your home directory. You need to change the line # c.NotebookApp.browser=”” to c.NotebookApp.browser=”C:/path/to/your/chrome.exe %s” On windows 10, Chrome should be located C:/Program Files (x86)/Google/Chrome/Application/chrome.exe but check on your system to … Read more

import a function from another .ipynb file

You’ll want to use the ipynb package/module importer. You’ll need to install it: pip install ipynb. Create a Notebook named my_functions.ipynb. Add a simple function to it. def factorial(n): if n == 0: return 1 else: return n * factorial(n-1) Then, create a second IPython Notebook and import this function with: from ipynb.fs.full.my_functions import factorial … Read more

How do I set up Jupyter/IPython Notebook for Django?

Install django-extensions from https://github.com/django-extensions/django-extensions/blob/master/docs/index.rst pip install django-extensions Change your settings file to include ‘django-extensions’ INSTALLED_APPS += [‘django_extensions’] Run your Django server like this: python manage.py shell_plus –notebook alter to suit, and run this in your first cell import os, sys PWD = os.getenv(‘PWD’) os.chdir(PWD) sys.path.insert(0, os.getenv(‘PWD’)) os.environ.setdefault(“DJANGO_SETTINGS_MODULE”, “local_settings.py”) import django django.setup() Now you should be … Read more

multi_line hover in bokeh

As of Bokeh 0.12.4 (earlier, actually but I forget the exact release) the hover tool supports mutli_line: from collections import defaultdict import numpy as np from scipy.stats import norm from bokeh.plotting import show, figure from bokeh.models import ColumnDataSource, HoverTool from bokeh.palettes import Viridis6 RT_x = np.linspace(118, 123, num=50) mass_spec = defaultdict(list) for scale, mz in … Read more

Packages from Conda env not found in Jupyer Notebook

Here are two possible solutions: You can register a new kernel based on your imagescraper environment. The kernel will start from the imagescraper environment and thus sees all its packages. source activate imagescraper conda install ipykernel ipython kernel install –name imagescraper This will add a new kernel named imagescraper to your jupyter dashboard. Another solution … Read more