ipython-notebook

Pipe Ipython magic output to a variable?

Pipe Ipython magic output to a variable? Question: I want to run a bash script in my ipython Notebook and save the output as a string in a python variable for further manipulation. Basically I want to pipe the output of the bash magic to a variable, For example the output of something like this: …

Total answers: 3

iPython notebook plantuml extension

iPython notebook plantuml extension Question: How can we use plantuml UML tool in iPython notebook? It should helpful for us since UML figure is frequently used during paper work. After some google from internet, I have found one excellent reference for Using Asymptote in iPython notebook, then I have created a plantuml extension for iPython …

Total answers: 3

How to display line numbers in IPython Notebook code cell by default

How to display line numbers in IPython Notebook code cell by default Question: I would like my default display for IPython notebook code cells to include line numbers. I learned from Showing line numbers in IPython/Jupyter Notebooks that I can toggle this with ctrl-M L, which is great, but manual. In order to include line …

Total answers: 3

View pdf image in an iPython Notebook

View pdf image in an iPython Notebook Question: The following code allows me to view a png image in an iPython notebook. Is there a way to view pdf image? I don’t need to use IPython.display necessarily. I am looking for a way to print a pdf image in a file to the iPython notebook …

Total answers: 4

How to (intermittently) skip certain cells when running IPython notebook?

How to (intermittently) skip certain cells when running IPython notebook? Question: I usually have to rerun (most parts of) a notebook when reopen it, in order to get access to previously defined variables and go on working. However, sometimes I’d like to skip some of the cells, which have no influence to subsequent cells (e.g., …

Total answers: 8

Matplotlib: Save figure as file from iPython notebook

Matplotlib: Save figure as file from iPython notebook Question: I am trying to save a Matplotlib figure as a file from an iPython notebook. import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_axes([1,1,1,1]) ax.plot([1,2]) fig.savefig(‘test.png’) The inline view in the iPython notebook looks good: The file ‘test.png’ is almost empty though. It looks like …

Total answers: 2

Draw graph in NetworkX

Draw graph in NetworkX Question: I’m trying to draw any graph in NetworkX, but get nothing, not even errors: import networkx as nx import matplotlib.pyplot as plt g1=nx.petersen_graph() nx.draw(g1) Asked By: denfromufa || Source Answers: Add to the end: plt.show() import networkx as nx import matplotlib.pyplot as plt g1 = nx.petersen_graph() nx.draw(g1) plt.show() When run …

Total answers: 4

IPython Notebook Multiple Checkpoints

IPython Notebook Multiple Checkpoints Question: I see that IPython Notebook has a menu item: File > Revert to Checkpoint, but this never contains more than a single entry for any of my notebooks. Is there a way to allow this menu to hold multiple checkpoints? I can’t find documentation about how to do this anywhere …

Total answers: 2

How to make Ipython output a list without line breaks after elements?

How to make Ipython output a list without line breaks after elements? Question: The IPython console prints a list of elements with line breaks so that each element is displayed in its own line. This is usually a feature, but in my case it is a bug: I need to copy and paste long lists, …

Total answers: 3

IPython Notebook save location

IPython Notebook save location Question: 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! Asked By: Yuxiang Wang || Source Answers: Yes, …

Total answers: 9