jupyter-notebook

Shortcut key for changing code cell to markdown cell in jupyter notebook

点点圈 提交于 2019-12-20 10:26:26
问题 Kind of silly but, is there a shortcut key to change a code cell to markdown cell. To place a markdown cell, I have to insert a cell, then go to the toolbar menu(below the main menu bar) and then select markdown instead of code. 回答1: Press M whilst in command mode (highlight around the selected cell should be blue, not green), use Esc to switch to command mode and Enter to switch back to edit mode. So, if you're editing a cell, the key presses to change the cell to a markdown cell are Esc , M

SSL: WRONG_VERSION_NUMBER when setting up public Juypter server

萝らか妹 提交于 2019-12-20 10:17:34
问题 I'm in the process of setting up a Juypter server to host my notebooks on. In /home/user/.jupyter/notebook_configuration.py c.NotebookApp.certfile = u'/home/user/.jupyter/mycert.pem' c.NotebookApp.keyfile = u'/home/user/.jupyter/mykey.key' And if I ran on the console jupyter notebook --ip="ip_address" --port=8000 --certfile=mycert.pem --keyfile mykey.key The server and the certificate worked! However, when I set up a DNS entry and attempt to route to the server I ran into this error SSL Error

Jupyter notebook not running code. Stuck on In [*]

冷暖自知 提交于 2019-12-20 09:55:10
问题 My code was running fine before I did not change anything and I ran it again. Now it doesn't return anything not even an error. It is just stuck on "In [*]". 回答1: This means that Jupyter is still running the kernel. It is possible that you are running an infinite loop within the kernel and that is why it can't complete the execution. Try manually stopping the kernel by pressing the stop button at the top. If that doesn't work, interrupt it and restart it by going to the "Kernel" menu. This

open ipython notebooks (*.ipynb) in read-only view (like a html file)

我们两清 提交于 2019-12-20 08:49:15
问题 Nowadays with more and more ipython notebook files (*.ipynb) around, it is very disturbing every time when I want to peek at some notebook I have to open a server for it, and cannot do it in read-only mode (due to auto-save I can accidentally change the file when reading it if not in read-only mode). I hope something like this: ipython notebook mynb.ipynb --read-only would work, but sadly it doesn't (although still it creates a server which I don't really want in read-only view). What I

jupyter notebook inline plots as svg

和自甴很熟 提交于 2019-12-20 08:38:43
问题 By default jupyter notebook inline plots are displayed as png, e.g.: import matplotlib.pyplot as plt %matplotlib inline plt.plot() How can you configure jupyter notebooks to display matplotlib inline plots as svg? 回答1: Use set_matplotlib_formats('svg'). import matplotlib.pyplot as plt from IPython.display import set_matplotlib_formats %matplotlib inline set_matplotlib_formats('svg') plt.plot() This is also documented in a document of %matplotlib magic. Note: InlineBackend.figure_format is

jupyter notebook inline plots as svg

不想你离开。 提交于 2019-12-20 08:38:15
问题 By default jupyter notebook inline plots are displayed as png, e.g.: import matplotlib.pyplot as plt %matplotlib inline plt.plot() How can you configure jupyter notebooks to display matplotlib inline plots as svg? 回答1: Use set_matplotlib_formats('svg'). import matplotlib.pyplot as plt from IPython.display import set_matplotlib_formats %matplotlib inline set_matplotlib_formats('svg') plt.plot() This is also documented in a document of %matplotlib magic. Note: InlineBackend.figure_format is

How to change working directory in Jupyter Notebook?

陌路散爱 提交于 2019-12-20 08:18:16
问题 I couldn't find a place for me to change the working directory in Jupyter Notebook, so I couldn't use the pd.read_csv method to read in a specific csv document. Is there any way to make it? FYI, I'm using Python3.5.1 currently. Thanks! 回答1: Running os.chdir(NEW_PATH) will change the working directory. import os os.getcwd() Out[2]: '/tmp' In [3]: os.chdir('/') In [4]: os.getcwd() Out[4]: '/' In [ ]: 回答2: First you need to create the config file, using cmd : jupyter notebook --generate-config

'%matplotlib inline' causes error in following code

半城伤御伤魂 提交于 2019-12-20 07:29:24
问题 If I comment out '%matplotlib inline' the code runs fine But if I leave '%matplotlib inline' uncommented, 'fig, axes = plt.subplots(nrows=x_p, ncols=y_p)' starts to create blank plots, and following code triggers error as below. Any idea why? 回答1: By default, figures are closed at the end of a cell. This means that pyplot ( plt ) has forgotten about the axes to work on in the next cell. %config InlineBackend tells us: InlineBackend.close_figures= <Bool> Current: False Close all figures at the

In an HTML table, how to add text beside plot in jupyter notebook using python?

有些话、适合烂在心里 提交于 2019-12-20 07:24:57
问题 Any ideas on how to create a 1 X 2 HTML table where cell {0} is a matplotlib plot and cell {1} is a text description for Python 3.X? import matplotlib.pyplot as plt from io import BytesIO %matplotlib inline def add_split_screen(fig, text, iwidth=None): figdata = BytesIO() fig.savefig(figdata, format='png') figdata.seek(0) figdata figdata.close() iwidth = ' width={0} '.format(iwidth) if iwidth is not None else '' datatable = '<table><tr><td>{0}</td><td>{1}</td></tr></table>'.format(figdata,

Strange values of training and testing when running my CNN in Tensorflow

▼魔方 西西 提交于 2019-12-20 06:43:41
问题 I´ve been trying to train and evaluate a convolutional neural network using my own data, which consists in 200 training images and 20 testing images. My complete script is here: Error while running a convolutional network using my own data in Tensorflow When I run it, I don´t get any error and it seems to complete the whole process just fine, but the training values and testing result change randomly each time I run it, so I think that it´s not training anything at all. When I print the