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 is a web application based on . It provides a frontend to many different languages and interactive shells.

Jupyter Notebook supports more than 40 different languages including , , and .

Each Jupyter Notebook document may contain executable code blocks, outputs, and Markdown text.

Jupyter Notebook is the successor to , which was part of the project. However, Jupyter and IPython are separate projects as of IPython 4.0.

More information

24660 questions
243
votes
8 answers

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 not with anaconda. How can I change it and use…
Victor
  • 2,521
  • 2
  • 11
  • 8
237
votes
13 answers

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

I have a directory structure similar to the following meta_project project1 __init__.py lib module.py __init__.py notebook_folder notebook.jpynb When working in notebook.jpynb if I try to use…
mpacer
  • 3,009
  • 2
  • 16
  • 15
233
votes
13 answers

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 callable, yet I want to hide / collapse the cell in order…
aloha
  • 4,554
  • 6
  • 32
  • 40
231
votes
12 answers

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 is, each time a new line has to be printed, a…
Rohan Saxena
  • 3,133
  • 2
  • 16
  • 34
225
votes
6 answers

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 showing the most recent data. no scrolling in the cell…
aha
  • 4,314
  • 4
  • 23
  • 27
214
votes
7 answers

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 know that the step got executed successfully, but…
Sabareesh Kappagantu
  • 2,367
  • 3
  • 18
  • 15
210
votes
23 answers

"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 through the interpreter, the module is…
CodeOcelot
  • 3,403
  • 3
  • 22
  • 23
203
votes
12 answers

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 in python notebook. I have tried: print…
WebOrCode
  • 6,852
  • 9
  • 43
  • 70
199
votes
23 answers

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 markdown cells are shown?
lucacerone
  • 9,859
  • 13
  • 52
  • 80
199
votes
11 answers

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 headings; there are 6 levels available, from level…
user2428107
  • 3,003
  • 3
  • 17
  • 19
198
votes
11 answers

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
  • 3,065
  • 4
  • 19
  • 31
198
votes
10 answers

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 "test" message inside the notebook?
Kyle Brandt
  • 26,938
  • 37
  • 124
  • 165
195
votes
4 answers

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 prints to stdout is not affected by the semi-colon. >>>…
Zero
  • 11,593
  • 9
  • 52
  • 70
193
votes
7 answers

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 installed the package nb_conda_kernels which is…
Statistic Dean
  • 4,861
  • 7
  • 22
  • 46
189
votes
33 answers

Running Jupyter via command line 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 following error 'jupyter' is not recognized as an…
eleijonmarck
  • 4,732
  • 4
  • 22
  • 24