ipython-notebook

How can I add a table of contents to an ipython notebook?

China☆狼群 提交于 2019-11-27 09:35:25
问题 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 1 (top level) down to level 6 (paragraph). These can be used later for constructing tables of contents, etc. However, I can't find instructions anywhere on how to use my hierarchical headings to create such a table of contents. Is there a way to do

ImportError: No module named notebook.notebookapp

心不动则不痛 提交于 2019-11-27 09:26:47
问题 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. 回答1: For 4.0 and above You need to install the notebook app separately from https://github.com/jupyter/notebook pip install jupyter 回答2: conda install jupyter will install latest jupyter along with other required dependencies The following packages will be downloaded:

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

早过忘川 提交于 2019-11-27 09:16:36
问题 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. 回答1: In 1.0, the functionality was bound to ( and tab and shift-tab , in 2.0 tab was

IPython Notebook save location

自闭症网瘾萝莉.ら 提交于 2019-11-27 09:09:28
问题 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! 回答1: 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

IPython Notebook output cell is truncating contents of my list

[亡魂溺海] 提交于 2019-11-27 09:00:48
I have a long list (about 4000 items) whose content is suppressed when I try to display it in an ipython notebook output cell. Maybe two-thirds is shown, but the end has a "...]", rather than all the contents of the list. How do I get ipython notebook to display the whole list instead of a cutoff version? pd.options.display.max_rows = 4000 worked for me See : http://pandas.pydata.org/pandas-docs/stable/options.html I know its a pretty old thread, but still wanted to post my answer in the hope it helps someone. You can change the number of max_seq_items shown by configuring the pandas options

How to hide <matplotlib.lines.Line2D> in IPython notebook

[亡魂溺海] 提交于 2019-11-27 08:11:58
I am plotting a NumPy array of values, I , using IPython notebook in %matplotlib inline mode with the plot command plt.plot(I,'o') . The resulting output is: <matplotlib.figure.Figure at 0x119e6ead0> Out[159]: [<matplotlib.lines.Line2D at 0x11ac57090>, <matplotlib.lines.Line2D at 0x11ac57310>, <matplotlib.lines.Line2D at 0x11ac57510>, <matplotlib.lines.Line2D at 0x11ac57690>, <matplotlib.lines.Line2D at 0x11ac57810>, <matplotlib.lines.Line2D at 0x11ac57990>, <matplotlib.lines.Line2D at 0x11ac57b10>, .... .... ] Then my plot shows up below these lines of output. Is there a way to just show the

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

谁说我不能喝 提交于 2019-11-27 06:28:58
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 I want to know how i can parse the excel file that has been read so that I can understand how the data in the excel maps to the data in the variable data. I learnt that data is a Dataframe object if I'm not wrong. So How do i parse this dataframe object to extract each line row by row. I usually create a dictionary containing a DataFrame for every

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

大城市里の小女人 提交于 2019-11-27 06:15:04
问题 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 回答1: Depending on the version of IPython you are using, there are more or less hackish ways to

ipython notebook pandas max allowable columns

感情迁移 提交于 2019-11-27 05:33:50
问题 I have a simple csv file with ten columns! When I set the following option in the notebook and print my csv file (which is in a pandas dataframe) it doesn't print all the columns from left to right, it prints the first two, the next two underneath and so on. I used this option, why isn't it working? pd.option_context("display.max_rows",1,"display.max_columns",100) Even this doesn't seem to work: pandas.set_option('display.max_columns', None) 回答1: I assume you want to display your data in the

Share data between IPython Notebooks

会有一股神秘感。 提交于 2019-11-27 05:33:20
问题 If I have several IPython notebooks running on the same server. Is there any way to share data between them? For example, importing a variable from another notebook? Thanks! 回答1: This works for me : The %store command lets you pass variables between two different notebooks. data = 'this is the string I want to pass to different notebook' %store data Now, in a new notebook… %store -r data print(data) this is the string I want to pass to different notebook I've successfully tested with sklearn