ipython-notebook

Change resolution of imshow in ipython

北慕城南 提交于 2019-11-30 17:51:16
I am using ipython, with a code that looks like this: image = zeros(MAX_X, MAX_Y) # do something complicated to get the pixel values... # pixel values are now in [0, 1]. imshow(image) However, the resulting image always has the same resolution, around (250x250). I thought that the image's dimensions would be (MAX_X x MAX_Y), but that is seemingly not the case. How can I make ipython give me an image with a greater resolution? The height and width of the displayed image on the screen is controlled by the figure size and the axes size. figure(figsize = (10,10)) # creates a figure 10 inches by 10

Matplotlib pyplot.title(string) returns error

老子叫甜甜 提交于 2019-11-30 17:30:24
When I call pyplot.title('some string') it throws the exception, 'str' object is not callable' . I copied the following from the matplotlib online documentation: mu, sigma = 100, 15 x = mu + sigma * np.random.randn(10000) # the histogram of the data n, bins, patches = plt.hist(x, 50, normed=1, facecolor='g', alpha=0.75) plt.xlabel('Smarts') plt.ylabel('Probability') plt.title('Histogram of IQ') plt.text(60, .025, r'$\mu=100,\ \sigma=15$') plt.axis([40, 160, 0, 0.03]) plt.grid(True) plt.show() and get TypeError Traceback (most recent call last) <ipython-input-158-40fe7a831b06> in <module>() 8

Getting output with IPython Notebook

老子叫甜甜 提交于 2019-11-30 17:22:35
When I launch IPython Notebook I can navigate to it and enter code. However, nothing is ever echo'd back to the IPython Notebook interface. I know the server is getting the queries (from --debug output ) and responding to them it's just never giving me output in my IPython Notebook window. I am running Python 2.6.6 and Windows 7 I am at a loss currently on how to get this notebook thing to work. Here is a screencast of me trying (unsuccessfully) to get output: http://screencast.com/t/TwJ2ZmGnT Even if you don't know what's wrong, any pointers on how to further debug my problems :( So far I

adding syntax highlighting to Jupyter notebook cell magic

不羁岁月 提交于 2019-11-30 15:37:05
问题 I'm trying to figure out how to activate CodeMirror syntax highlighting for a CodeMirror-supported language (cypher) within a cell for a custom Jupyter cell magic ( %%mymagic ). The magic isn't associated with a special kernel - it just runs Python commands that process the string entered into the cell that I want to highlight. From what I can tell, this ostensibly can be done using something like from notebook.services.config.manager import ConfigManager cm = ConfigManager() cm.update(

Ipython notebook will not start on command line

大兔子大兔子 提交于 2019-11-30 15:35:46
问题 I tried to open ipython in terminal with ipython notebook and it will not open ipython notebook. It gives the following error: | ~/documents/ud120-projects/datasets_questions @ HJ (JiaHui) | => ipython notebook [TerminalIPythonApp] WARNING | Subcommand `ipython notebook` is deprecated and will be removed in future versions. [TerminalIPythonApp] WARNING | You likely want to use `jupyter notebook` in the future [I 14:46:50.516 NotebookApp] Serving notebooks from local directory: /Users/JiaHui

Including a notebook in another notebook in IPython?

最后都变了- 提交于 2019-11-30 15:04:43
I have a notebook which I intend to use as a library for other notebooks. It has some functions that can ready certain types of files etc. How can I include that notebook in a new notebook that should be able to use the functions in the library notebook? googling for notebook import hook yield some example s. This is still experimental, but you are welcomed to improved it. I would suggest also using the --script flag that save an importable .py file every time you save the notebook. You can just enter %run 'NotebookA.ipynb' in Notebook B and you should be good to go! With import_ipynb library

Ipython notebook will not start on command line

我怕爱的太早我们不能终老 提交于 2019-11-30 14:20:46
I tried to open ipython in terminal with ipython notebook and it will not open ipython notebook. It gives the following error: | ~/documents/ud120-projects/datasets_questions @ HJ (JiaHui) | => ipython notebook [TerminalIPythonApp] WARNING | Subcommand `ipython notebook` is deprecated and will be removed in future versions. [TerminalIPythonApp] WARNING | You likely want to use `jupyter notebook` in the future [I 14:46:50.516 NotebookApp] Serving notebooks from local directory: /Users/JiaHui/Documents/ud120-projects/datasets_questions [I 14:46:50.517 NotebookApp] 0 active kernels [I 14:46:50

Displaying ggplot2 graphs from R in Jupyter

被刻印的时光 ゝ 提交于 2019-11-30 14:09:12
问题 When I create a plot in Jupyter using the ggplot2 R package, I get a link to the chart that says "View PDF" instead of the chart being presented inline. I know that traditionally in IPython Notebook you were able to show the charts inline using the %matplotlib magic function. Does Jupyter have something similar for R and ggplot2? What do I need to do to show the graph inline versus as a link to a PDF? 回答1: You can show the graphs inline with this option. options(jupyter.plot_mimetypes =

Why is matplotlib plot produced from ipython notebook slightly different from terminal version?

风格不统一 提交于 2019-11-30 13:25:57
问题 I have a strange issue. Using IPython Notebook, I created a quite extensive script using pandas and matplotlib to create a number of charts. When my tinkering was finished, I copied (and cleaned) the code into a standalone python script (so that I can push it into the svn and my paper co-authors can create the charts as well). For convenience, I import the standalone python script into the notebook again and create a number of charts: import create_charts as cc df = cc.read_csv_files("./data"

How do I get IPython profile behavior from Jupyter 4.x?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 13:06:14
问题 There was official(?) recommendation of running an IPython Notebook server, and creating a profile via $ ipython profile create nbserver as recommended in http://ipython.org/ipython-doc/1/interactive/public_server.html. This allowed for very different and very useful behavior when starting an IPython Notebook via ipython notebook and ipython notebook --profile=nbserver . With Jupyter 4.0, there's a change and there are no longer profiles. I've found the conversation https://gitter.im/ipython