Questions tagged [jupyter-notebook]

The Jupyter Notebook is a web application that provides a frontend to many different languages and interactive shells such as IPython. Jupyter Notebook, unlike its predecessor IPython Notebook, supports many different languages and interactive shells in addition to Python and IPython. DO NOT use this tag on questions regarding code which merely happens to be written using Jupyter Notebooks, use the appropriate language tag instead, e.g. [python], [r].

jupyter-notebook
Filter by
Sorted by
Tagged with
948 votes
11 answers
1.3m views

How to make IPython notebook matplotlib plot inline

I am trying to use IPython notebook on MacOS X with Python 2.7.2 and IPython 1.1.0. I cannot get matplotlib graphics to show up inline. import matplotlib import numpy as np import matplotlib.pyplot ...
Ian Fiske's user avatar
  • 10.5k
939 votes
12 answers
1.0m views

Purpose of "%matplotlib inline"

What exactly is the use of %matplotlib inline?
Rishabh's user avatar
  • 9,697
646 votes
23 answers
90k views

Using IPython / Jupyter Notebooks Under Version Control

What is a good strategy for keeping IPython notebooks under version control? The notebook format is quite amenable for version control: if one wants to version control the notebook and the outputs ...
mforbes's user avatar
  • 7,151
578 votes
26 answers
582k views

Conda environments not showing up in Jupyter Notebook

I installed Anaconda (with Python 2.7), and installed Tensorflow in an environment called tensorflow. I can import Tensorflow successfully in that environment. The problem is that Jupyter Notebook ...
user31039's user avatar
  • 6,359
556 votes
16 answers
414k views

How do I increase the cell width of the Jupyter/ipython notebook in my browser?

I would like to increase the width of the ipython notebook in my browser. I have a high-resolution screen, and I would like to expand the cell width/size to make use of this extra space. Thanks!
vgoklani's user avatar
  • 11.3k
534 votes
39 answers
1.0m views

How to change the Jupyter start-up folder

I tried following the instructions given on the Jupyter Notebook documentation. Unfortunately, I haven't been able to figure it out. Where exactly is this "start in" field? I've a windows 7 (64 bit) ...
kchak's user avatar
  • 7,812
510 votes
19 answers
787k views

Change the Theme in Jupyter Notebook?

I like dark themes. However, the default theme of Jupyter notebooks is light, and I can't find the option to change the theme/background-color. How is this done?
Moby Khan's user avatar
  • 5,206
497 votes
19 answers
813k views

How to embed image or picture in jupyter notebook, either from a local machine or from a web resource?

I would like to include image in a jupyter notebook. If I did the following, it works : from IPython.display import Image Image("img/picture.png") But I would like to include the images in a ...
Ger's user avatar
  • 9,306
460 votes
8 answers
343k views

What is the difference between Jupyter Notebook and JupyterLab?

I am new to Jupyter Notebook, what is the key difference between the Jupyter Notebook and JupyterLab, suggest me to choose the best one, which should be used in future.
krist's user avatar
  • 4,707
424 votes
20 answers
463k views

How do I convert a IPython Notebook into a Python file via commandline?

I'm looking at using the *.ipynb files as the source of truth and programmatically 'compiling' them into .py files for scheduled jobs/tasks. The only way I understand to do this is via the GUI. Is ...
Stefan Krawczyk's user avatar
419 votes
10 answers
516k views

How to make inline plots in Jupyter Notebook larger? [duplicate]

I have made my plots inline on my Ipython Notebook with "%matplotlib inline." Now, the plot appears. However, it is very small. Is there a way to make it appear larger using either notebook ...
Chris's user avatar
  • 30.1k
381 votes
21 answers
373k views

Jupyter Notebook not saving: '_xsrf' argument missing from post

I've been running a script on jupyter notebooks for about 26 hour; I haven't really been using my computer for anything else, but it needs to run this program that will take ~30 hours to complete. At ...
V P's user avatar
  • 3,864
376 votes
25 answers
551k views

How do I add python3 kernel to jupyter (IPython)

My Jupyter notebooks installed with python 2 kernel. I do not understand why. I might have messed something up when I did the install. I already have python 3 installed. How can I add it to Jupyter? ...
quickbug's user avatar
  • 4,788
364 votes
15 answers
460k views

How to write LaTeX in IPython Notebook?

How can I display LaTeX code in a IPython Notebook?
KostasA's user avatar
  • 5,394
363 votes
18 answers
574k views

How do I block comment in Jupyter notebook? [closed]

I want to comment out a block of multiple lines in Jupyter Notebook, but can't find out how to do that in this current version. It used to be in one of the drop down menus but is no longer there. How ...
chrisfs's user avatar
  • 6,243
361 votes
9 answers
468k views

Show DataFrame as table in iPython Notebook

I am using iPython notebook. When I do this: df I get a beautiful table with cells. However, if i do this: df1 df2 it doesn't print the first beautiful table. If I try this: print df1 print ...
Chris's user avatar
  • 13.3k
345 votes
14 answers
563k views

Simple way to measure cell execution time in ipython notebook

I would like to get the time spent on the cell execution in addition to the original output from cell. To this end, I tried %%timeit -r1 -n1 but it doesn't expose the variable defined within cell. %%...
colinfang's user avatar
  • 21.4k
345 votes
17 answers
497k views

In which conda environment is Jupyter executing?

I have jupyter/anaconda/python3.5. How can I know which conda environment is my jupyter notebook running on? How can I launch jupyter from a new conda environment?
RockScience's user avatar
  • 18.2k
345 votes
10 answers
631k views

Pandas: Setting no. of max rows

I have a problem viewing the following DataFrame: n = 100 foo = DataFrame(index=range(n)) foo['floats'] = np.random.randn(n) foo The problem is that it does not print all rows per default in ...
Andy's user avatar
  • 9,741
331 votes
16 answers
529k views

How can I display an image from a file in Jupyter Notebook?

I would like to use an IPython notebook as a way to interactively analyze some genome charts I am making with Biopython's GenomeDiagram module. While there is extensive documentation on how to use ...
zach's user avatar
  • 30.4k
331 votes
32 answers
695k views

After installing with pip, "jupyter: command not found"

After installing with pip install jupyter, terminal still cannot find jupyter notebook. Ubuntu simply says command not found. Similar with ipython. Did pip not get install properly or something? ...
john mangual's user avatar
  • 8,018
331 votes
39 answers
414k views

How can I prevent Google Colab from disconnecting?

Is there a way to programmatically prevent Google Colab from disconnecting on a timeout? The following describes the conditions causing a notebook to automatically disconnect: Google Colab notebooks ...
Chan Kha Vu's user avatar
  • 10.1k
325 votes
14 answers
515k views

Inserting image into IPython notebook markdown

I am starting to depend heavily on the IPython notebook app to develop and document algorithms. It is awesome; but there is something that seems like it should be possible, but I can't figure out how ...
benpro's user avatar
  • 4,355
323 votes
32 answers
778k views

Change IPython/Jupyter notebook working directory

When I open a Jupyter notebook (formerly IPython) it defaults to C:\Users\USERNAME. How can I change this so to another location?
John's user avatar
  • 42.2k
309 votes
6 answers
304k views

Autoreload of modules in IPython [duplicate]

Is there a way to have IPython automatically reload all changed code? Either before each line is executed in the shell or failing that when it is specifically requested to. I'm doing a lot of ...
Thomas Parslow's user avatar
283 votes
8 answers
291k views

Remove the kernel on a Jupyter Notebook

How can I remove a kernel from Jupyter Notebook? I have an R kernel on my Jupyter Notebook. Recently, the kernel always dies right after I open a new notebook.
zesla's user avatar
  • 11.3k
283 votes
15 answers
470k views

How to run an .ipynb Jupyter Notebook from terminal?

I have some code in a .ipynb file and got it to the point where I don't really need the "interactive" feature of IPython Notebook. I would like to just run it straight from a Mac Terminal ...
Vincent's user avatar
  • 8,388
273 votes
6 answers
405k views

How to load/edit/run/save text files (.py) into an IPython notebook cell?

I've recently moved over to using IPython notebooks as part of my workflow. However, I've not been successful in finding a way to import .py files into the individual cells of an open IPython ...
aaronsstack's user avatar
  • 2,833
267 votes
11 answers
336k views

Using both Python 2.x and Python 3.x in IPython Notebook

I use IPython notebooks and would like to be able to select to create a 2.x or 3.x python notebook in IPython. I initially had Anaconda. With Anaconda a global environment variable had to be changed ...
deltap's user avatar
  • 4,206
252 votes
6 answers
349k views

How to embed HTML into IPython output?

Is it possible to embed rendered HTML output into IPython output? One way is to use from IPython.core.display import HTML HTML('<a href="http://example.com">link</a>') or (IPython ...
Anton Tarasenko's user avatar
245 votes
8 answers
460k views

How to know which Python is running in Jupyter notebook?

I use Jupyter notebook in a browser for Python programming, I have installed Anaconda (Python 3.5). But I'm quite sure that Jupyter is running my python commands with the native python interpreter and ...
Victor's user avatar
  • 2,541
244 votes
13 answers
210k views

Import local function from a module housed in another directory with relative imports in Jupyter Notebook using Python 3 [duplicate]

I have a directory structure similar to the following meta_project project1 __init__.py lib module.py __init__.py notebook_folder notebook....
mpacer's user avatar
  • 3,087
241 votes
12 answers
312k views

tqdm in Jupyter Notebook prints new progress bars repeatedly

I am using tqdm to print progress in a script I'm running in a Jupyter notebook. I am printing all messages to the console via tqdm.write(). However, this still gives me a skewed output like so: That ...
Rohan Saxena's user avatar
  • 3,263
238 votes
6 answers
380k views

ipython notebook clear cell output in code

In a iPython notebook, I have a while loop that listens to a Serial port and print the received data in real time. What I want to achieve to only show the latest received data (i.e only one line ...
aha's user avatar
  • 4,454
235 votes
13 answers
280k views

collapse cell in jupyter notebook

I am using ipython Jupyter notebook. Let's say I defined a function that occupies a lot of space on my screen. Is there a way to collapse the cell? I want the function to remain executed and ...
aloha's user avatar
  • 4,624
227 votes
7 answers
719k views

How to read a .xlsx file using the pandas Library in iPython?

I want to read a .xlsx file using the Pandas Library of python and port the data to a postgreSQL table. All I could do up until now is: import pandas as pd data = pd.ExcelFile("*File Name*") Now I ...
Sabareesh Kappagantu's user avatar
220 votes
12 answers
324k views

How to show PIL Image in ipython notebook

This is my code from PIL import Image pil_im = Image.open('data/empire.jpg') I would like to do some image manipulation on it, and then show it on screen. I am having problem with showing PIL Image ...
WebOrCode's user avatar
  • 7,112
219 votes
12 answers
360k views

How to set env variable in Jupyter notebook

I've a problem that Jupyter can't see env variable in bashrc file. Is there a way to load these variables in jupyter or add custom variables to it?
Ehab AlBadawy's user avatar
215 votes
23 answers
447k views

"ImportError: No module named" when trying to run Python script

I'm trying to run a script that launches, amongst other things, a python script. I get a ImportError: No module named ..., however, if I launch ipython and import the same module in the same way ...
CodeOcelot's user avatar
  • 3,463
210 votes
10 answers
162k views

Get Output From the logging Module in IPython Notebook

When I running the following inside IPython Notebook I don't see any output: import logging logging.basicConfig(level=logging.DEBUG) logging.debug("test") Anyone know how to make it so I can see the ...
Kyle Brandt's user avatar
  • 27.6k
207 votes
8 answers
176k views

How to add conda environment to jupyter lab

I'm using Jupyter Lab and I'm having trouble to add conda environment. The idea is to launch Jupyter Lab from my base environment, and then to be able to choose my other conda envs as kernels. I ...
Statistic Dean's user avatar
207 votes
11 answers
279k views

How can I add a table of contents to a Jupyter / JupyterLab notebook?

The documentation at http://ipython.org/ipython-doc/stable/interactive/notebook.html says You can provide a conceptual structure for your computational document as a whole using different levels of ...
user2428107's user avatar
  • 3,143
204 votes
34 answers
671k views

How to fix "'jupyter' is not recognized as an internal or external command, operable program or batch file" when running Jupyter on Windows?

I have installed Jupyter on Windows 10, Python 3.x via $ pip install jupyter The installation works fine, even though I did restart the terminal. But trying to run $ jupyter notebook gives the ...
eleijonmarck's user avatar
  • 4,972
200 votes
24 answers
233k views

How to hide code from cells in ipython notebook visualized with nbviewer?

I have an ipython/jupyter notebook that I visualize using NBviewer. How can I hide all the code from the notebook rendered by NBviewer, so that only the output of code (e.g. plots and tables) and the ...
lucacerone's user avatar
  • 9,999
200 votes
5 answers
189k views

How do you suppress output in Jupyter running IPython?

How can output to stdout be suppressed? A semi-colon can be used to supress display of returned objects, for example >>> 1+1 2 >>> 1+1; # No output! However, a function that ...
Zero's user avatar
  • 11.8k
195 votes
13 answers
458k views

IOPub data rate exceeded in Jupyter notebook (when viewing image)

I want to view an image in Jupyter notebook. It's a 9.9MB .png file. from IPython.display import Image Image(filename='path_to_image/image.png') I get the below error: IOPub data rate exceeded. The ...
lmart999's user avatar
  • 6,911
189 votes
10 answers
189k views

Jupyter/IPython Notebooks: Shortcut for "run all"?

Is there a shortcut to run all cells in an IPython notebook? And if not, does this have a specific reason?
user3017048's user avatar
  • 2,881
188 votes
5 answers
218k views

How can I see function arguments in IPython Notebook Server 3?

I've recently switched to IPython Notebook 3 (3.1.0-cbccb68 to be exact), the Anaconda version. Previously when I typed a function and opened a parenthesis like this: time.sleep() and if the cursor ...
user11094's user avatar
  • 2,041
186 votes
10 answers
354k views

How to change color in markdown cells ipython/jupyter notebook?

I'm only looking to format a specific string within a cell. I change that cell's format to "Markdown" but I'm not sure how to change text color of a single word. I don't want to change the look of ...
punkrockpolly's user avatar
181 votes
6 answers
161k views

How can I share Jupyter notebooks with non-programmers? [closed]

I am trying to wrap my head around what I can/cannot do with Jupyter. I have a Jupyter server running on our internal server, accessible via VPN and password protected. I am the only one actually ...
xav's user avatar
  • 4,191

1
2 3 4 5
503