ipython-notebook

Plot width settings in ipython notebook

半城伤御伤魂 提交于 2019-11-28 15:56:03
问题 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 numpy as np import matplotlib.pyplot as plt def show_plots2d(title, plots, points, xlabel = '', ylabel = ''): """ Shows 2D plot. Arguments: title : string Title of the plot. plots : array_like of pairs like array_like and array_like List of pairs,

ImportError: No module named notebook.notebookapp

自闭症网瘾萝莉.ら 提交于 2019-11-28 15:55:46
What do you recommend guys for this error when I type in console ipython notebook and got ImportError: No module named notebook.notebookapp ? I installed ipython notebook with pip and really I don't know what is going on. user2429409 For 4.0 and above You need to install the notebook app separately from https://github.com/jupyter/notebook pip install jupyter conda install jupyter will install latest jupyter along with other required dependencies The following packages will be downloaded: package | build ---------------------------|----------------- mistune-0.7 | py27_0 186 KB jinja2-2.8 | py27

Display multiple images in one IPython Notebook cell?

北战南征 提交于 2019-11-28 15:47:14
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: display(Image(ima)) But I just get a broken image link: minrk Short answer: call plt.figure() to create new figures if you want more than one in a cell: for ima in images: plt.figure() plt.imshow(ima) But to clarify the confusion with Image : IPython.display.Image is for displaying Image files , not array data. If you want to display numpy arrays with Image,

How to close IPython Notebook properly?

青春壹個敷衍的年華 提交于 2019-11-28 15:41:20
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 iPython). There isn't currently a better way to do it than Ctrl+C in the terminal. We're thinking about how to have an explicit shutdown, but there's some tension between the notebook as a single-user application, where the user is free to stop it, and as a multi-user server, where only an admin should be able to stop it. We haven't quite worked out how to

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

允我心安 提交于 2019-11-28 15:41:09
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 was between the parentheses then I would get a contextual overlay menu that displayed the function arguments. Now I don't see it, and although I've searched, I can't find out how I can turn on this functionality. In 1.0, the functionality was bound to ( and tab and shift-tab , in 2.0 tab was deprecated but still functional in some unambiguous cases completing or inspecting were competing in many

IPython Notebook save location

旧时模样 提交于 2019-11-28 15:25:22
I just started IPython Notebook, and I tried to use "Save" to save my progress. However, instead of saving the *.ipynb in my current working directory, it is saved in my python/Scripts folder. Would there be a way to set this? Thanks! Viktor Kerkez Yes, you can specify the notebooks location in your profile configuration. Since it's not saving them to the directory where you started the notebook, I assume that you have this option set in your profile. You can find out the the path to the profiles directory by using: $ ipython locate Either in your default profile or in the profile you use,

IPython Notebook cell multiple outputs

谁说胖子不能爱 提交于 2019-11-28 14:36:15
问题 I am running this cell in IPython Notebook: # salaries and teams are Pandas dataframe salaries.head() teams.head() The result is that I am only getting the output of teams data-frame rather than of both salaries and teams . If I just run salaries.head() I get the result for salaries data-frame but on running both the statement I just see the output of teams.head() . How can I correct this? 回答1: have you tried the display command? from IPython.display import display display(salaries.head())

How to start an ipython shell(not notebook) within a conda or virtualenv

六月ゝ 毕业季﹏ 提交于 2019-11-28 11:46:26
Is it possible to start an ipython shell(in terminal) within a conda or virtualenv ? The ipython shell should belongs to the respective environment. I know a way to start jupyter notebook within the env, by creating a kernelspecs for the virtual env and then choosing the env kernel within the jupyter notebook. here is the link : http://help.pythonanywhere.com/pages/IPythonNotebookVirtualenvs But this only setup the jupyter notebook for the current environment. Is there a to do the same for ipython shell The answer given by Grisha Levit almost solved the problem. So, i am writing the complete

ipython notebook nbconvert - how to remove red 'out[N]' text in top left hand corner of cell output?

一世执手 提交于 2019-11-28 11:24:00
I am using nbconvert to produce something as close as possible to a polished journal article. I have successfully hidden input code using a custom nbconvert template. The doc is now looking very nice. But I don't know how to suppress the bright red 'out[x]' statement in the top left corner of the output cells. Anyone know of any settings or hacks that are able to remove this also ? Thanks, John Depending on the version of IPython you are using, there are more or less hackish ways to remove the Out[ ] prompts. IPython 1.x Assuming that you use the latex_article base, a custom template (sphinx

Run parts of a ipython notebook in a loop / with different input parameter

心已入冬 提交于 2019-11-28 10:49:29
I have written a ipython notebook, which analyses a dataset. Now I want to use this code to loop over different datasets. The code is split into about 50 cells (including comments, markdown explanations,...). Is there a way to run parts of a notebook in a loop or running a whole notebook with different input parameters? I don't want to merge all cells into one function or download the code as a python script, as I really like to run (and experimenting with) parts of the analysis by executing only certain cells. Basically its refactoring parts of a script into a function and calling the