Questions tagged [ipython]

IPython is a feature-rich interactive shell for Python, and provides a kernel for frontends such as IPython Notebook and Jupyter Notebook.

IPython provides a rich architecture for interactive computing with . It includes:


Version updates:

The IPython 3.x release series is the last where IPython is released as one big package. Starting with IPython 4.0, the parts which work for any language are called , while the parts specific to executing Python code remain as IPython.

IPython 5.0 is the last major release to support Python 2.x.


Links:

7180 questions
151
votes
16 answers

Importing .py files in Google Colab

Is there any way to upload my code in .py files and import them in colab code cells? The other way I found is to create a local Jupyter notebook then upload it to Colab, is it the only way?
Reham M Samir
  • 1,635
  • 2
  • 8
  • 11
150
votes
5 answers

Adding an arbitrary line to a matplotlib plot in ipython notebook

I'm rather new to both python/matplotlib and using it through the ipython notebook. I'm trying to add some annotation lines to an existing graph and I can't figure out how to render the lines on a graph. So, for example, if I plot the…
JD Long
  • 59,675
  • 58
  • 202
  • 294
150
votes
16 answers

How to close IPython Notebook properly?

How to close IPython Notebook properly? Currently, I just close the browser tabs and then use Ctrl+C in the terminal. Unfortunately, neither exit() nor ticking Kill kernel upon exit does help (they do kill the kernel they but don't exit the…
Piotr Migdal
  • 11,864
  • 9
  • 64
  • 86
149
votes
6 answers

Javascript Error: IPython is not defined in JupyterLab

I have the latest/updated Anaconda package. Everytime I try to plot something using python 3.6.6 I get the following error in JupyterLab... Javascript Error: IPython is not defined When I run the same code in Spyder using an ipython kernel, it…
AntMan
  • 1,493
  • 2
  • 8
  • 5
146
votes
9 answers

Automatically import modules when entering the python or ipython interpreter

I find myself typing import numpy as np almost every single time I fire up the python interpreter. How do I set up the python or ipython interpreter so that numpy is automatically imported?
user545424
  • 15,713
  • 11
  • 56
  • 70
145
votes
3 answers

How to pickle or store Jupyter (IPython) notebook session for later

Let's say I am doing a larger data analysis in Jupyter/Ipython notebook with lots of time consuming computations done. Then, for some reason, I have to shut down the jupyter local server I, but I would like to return to doing the analysis later,…
redacted
  • 3,789
  • 6
  • 25
  • 38
145
votes
11 answers

What is the right way to debug in iPython notebook?

As I know, %debug magic can do debug within one cell. However, I have function calls across multiple cells. For example, In[1]: def fun1(a) def fun2(b) # I want to set a breakpoint for the following line # …
Rex
  • 2,097
  • 5
  • 16
  • 18
144
votes
17 answers

How can I check if code is executed in the IPython notebook?

I have some Python code example I'd like to share that should do something different if executed in the terminal Python / IPython or in the IPython notebook. How can I check from my Python code if it's running in the IPython notebook?
Christoph
  • 2,790
  • 2
  • 18
  • 23
134
votes
5 answers

how to "reimport" module to python then code be changed after import

I have a foo.py def foo(): print "test" In IPython I use: In [6]: import foo In [7]: foo.foo() test Then I changed the foo() to: def foo(): print "test changed" In IPython, the result for invoking is still test: In [10]: import foo In…
user478514
  • 3,859
  • 10
  • 33
  • 42
132
votes
1 answer

What are Jupyter Notebook checkpoint files for?

Besides the original Jupyter Notebook file (.ipynb file), sometimes I get a checkpoint .ipynb file which seems to be directly linked to the original .ipynb file. What's the purpose of these checkpoint files? And what causes them to be generated…
Alex
  • 3,958
  • 4
  • 17
  • 24
131
votes
12 answers

OSX El Capitan: sudo pip install OSError: [Errno: 1] Operation not permitted

When I run: sudo pip install ipython I get the following error OSError: [Errno: 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/share' The last command executed tries to create the directory given…
Milad M
  • 1,538
  • 2
  • 13
  • 13
129
votes
2 answers

How to reference a IPython notebook cell in markdown?

How do I reference a cell in a IPython notebook markdown? I know how to make a reference to an external link. But is there a way to assign an ID to a cell and then refer to the cell in the markdown?
Michael_Scharf
  • 33,154
  • 22
  • 74
  • 95
129
votes
21 answers

How to convert IPython notebooks to PDF and HTML?

I want to convert my ipython-notebooks to print them, or simply send them in html format. I have noticed that there exists a tool to do that already, nbconvert. Although I have downloaded it, I have no idea how to convert the notebook, with…
nunzio13n
  • 1,455
  • 2
  • 10
  • 9
126
votes
4 answers

Disable IPython Exit Confirmation

It's really irritating that every time I type exit(), I get prompted with a confirmation to exit; of course I want to exit! Otherwise, I would not have written exit()!!! Is there a way to override IPython's default behaviour to make it exit without…
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
125
votes
17 answers

Convert JSON IPython notebook (.ipynb) to .py file

How do you convert an IPython notebook file (json with .ipynb extension) into a regular .py module?
Nitesh Selkari
  • 1,367
  • 3
  • 9
  • 10