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
106
votes
19 answers

`ipython` tab autocomplete does not work on imported module

Tab completion on IPython seems not to be working. For example, import numpy numpy. simply adds a tab. import numpy num just adds a tab, too. Could you please suggest some possible causes for this problem? I am running Windows 7 and…
djpark121
  • 1,191
  • 3
  • 10
  • 5
103
votes
9 answers

How To Get IPython Notebook To Run Python 3?

I am new to Python to bear with me. I installed Anaconda, works great. I setup a Python 3 environment following the Anaconda cmd line instructions, works great. I setup Anaconda's Python 3 environment as Pycharm's interpreter, works great. I…
Anton
  • 4,765
  • 12
  • 36
  • 50
102
votes
5 answers

How to pass a variable to magic ´run´ function in IPython

I want to do something like the following: In[1]: name = 'long_name_to_type_every_now_and_then.py' In[2]: %run name but this actually tries to run 'name.py', which is not what I want to do. Is there a general way to turn variables into strings?…
nadapez
  • 2,603
  • 2
  • 20
  • 26
101
votes
6 answers

How does IPython's magic %paste work?

I want to copy already indented Python code / whole functions and classes into IPython. Everytime I try the indentation is screwed up and I get following error message: IndentationError: unindent does not match any outer indentation level…
Framester
  • 33,341
  • 51
  • 130
  • 192
99
votes
6 answers

ipython notebook --pylab inline: zooming of a plot

Is it possible to zoom into a plot if inline is activated? Especially regarding to 3d-plots rotating and zooming is a necessary feature.
varantir
  • 6,624
  • 6
  • 36
  • 57
98
votes
8 answers

Calling IPython from a virtualenv

I understand that IPython is not virtualenv-aware and that the most logical solution to this is to install ipython in each virtualenv seperately using pip install ipython So far so good. One thing I noticed is that if the system-wide copy of…
Mo Sander
  • 1,303
  • 1
  • 10
  • 14
97
votes
10 answers

How do I reset the Jupyter/IPython input prompt numbering?

I just wrote my first extensive Python tutorial using IPython notebooks. All went well, except I did a lot of testing and moving blocks around. How do I reset the In [ ]: numbering? I have tried quitting and reloading, but that doesn't seem to…
user2651084
  • 981
  • 1
  • 6
  • 3
93
votes
11 answers

IPython and Jupyter autocomplete not working

I am very new to this and don't know why the autocomplete is not working. I tried modifying the iPython config file, installed readline, but still nothing.
user2822693
  • 1,300
  • 2
  • 10
  • 15
91
votes
9 answers

How do I set up Jupyter/IPython Notebook for Django?

I have been using the method described in this post for setting up IPython Notebook to play nicely with Django. The gist of the method is to create an IPython extension which sets the DJANGO_SETTINGS_MODULE and runs django.setup() when IPython…
odedbd
  • 2,285
  • 3
  • 25
  • 33
91
votes
4 answers

Can I use variables on an IPython notebook markup cell?

I have an IPython notebook and I would like to use one of my variables inside a markup cell. Is this even possible? If so, how do you do it?
Juan M. Caicedo
  • 1,066
  • 1
  • 7
  • 6
89
votes
6 answers

IPython Notebook - early exit from cell

I'd like to programmatically exit a cell early in IPython Notebook. exit(0), however, kills the kernel. Whats the proper way to do this? I'd prefer not to split the cell or manually halt execution.
watsonic
  • 3,155
  • 1
  • 27
  • 31
87
votes
3 answers

Plot width settings in ipython notebook

I've got the following plots: It would look nicer if they have the same width. Do you have any idea how to do it in ipython notebook when I am using %matplotlib inline? UPDATE: To generate both figures I am using the following functions: import…
pt12lol
  • 2,332
  • 1
  • 22
  • 48
87
votes
5 answers

What is %pylab?

I keep seeing people use %pylab in various code snippits, particularly with iPython. However, I cannot see where %pylab is mentioned anywhere in Learning Python (and the few other Python books I have) and am not really sure what it means. I'm sure…
Anton
  • 4,765
  • 12
  • 36
  • 50
87
votes
13 answers

Display multiple images in one IPython Notebook cell?

If I have multiple images (loaded as NumPy arrays) how can I display the in one IPython Notebook cell? I know that I can use plt.imshow(ima) to display one image… but I want to show more than one at a time. I have tried: for ima in images: …
David Wolever
  • 148,955
  • 89
  • 346
  • 502
86
votes
6 answers

How to Copy from IPython session without terminal prompts

Frequently, my workflow involves data cleaning/munging in an IPython shell. This has become particularly wonderful since IPython version 5.0 with all the great upgrades to the terminal interface. So, let's say I make an attempt at sprucing up some…
juanpa.arrivillaga
  • 88,713
  • 10
  • 131
  • 172