I want to put couple of cells with commands I need in almost every new notebook in every new notebook I create.
For example when I create a new notebook it should put a
%matplotlib inline
import matplotlib.pyplot as plt
in a cell by default but not execute it. How could I set something like that up?
In the start menu, right click Jupyter Notebook -> Properties . In the Target field, change %USERPROFILE% to your new "D:\path" .
To create a jupyter_notebook_config.py file in the . jupyter directory, with all the defaults commented out, use the following command: $ jupyter notebook --generate-config :ref:`Command line arguments for configuration <config>` settings are documented in the configuration file and the user documentation.
Generally, the default location is /Users/<your_profile>/. ipython/profile_default/startup in Mac. You can find your startup directory by running this in a Jypyter Notebook cell.
This will work for both terminal based IPython shell and Browser based Notebook:
~/.ipython/profile_default
startup
if it’s not already therestart.py
imports
(and custom functions
may be) in this fileHere is my sample for start.py
:
Another Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With