ipython-notebook

How to write text in ipython notebook?

ぐ巨炮叔叔 提交于 2019-12-20 08:48:28
问题 Here is an example of IPython notebook in which besides the input and output cells we have a plain text. How can I do the same in my IPython notebook? At the moment I have inly In and Out cells. 回答1: Change the cell type to Markdown in the menu bar, from Code to Markdown . Currently in Notebook 4.x , the keyboard shortcut for such an action is: Esc (for command mode), then m (for markdown). 回答2: As it is written in the documentation you have to change the cell type to a markdown. 回答3: Simply

Loading AMSmath explicitly in IPython notebook causes “[Math Processing Error]”

孤街浪徒 提交于 2019-12-20 04:25:07
问题 I am a relatively new IPython Notebook user and I am using IPython 3.2.1. So upfront, my apologies if I did not read some documentation carefully! I am trying to typeset some LaTeX in my Notebook intended for a presentation. I tried to utilize MathJax capabilities better than what's (supposedly) available by default and so tried incorporating other extensions that come with MathJax explicitly. In particular, I tried getting my IPython Notebook to load AMScd.js, AMSsymbols.js and unicode.js

Loading AMSmath explicitly in IPython notebook causes “[Math Processing Error]”

北战南征 提交于 2019-12-20 04:25:04
问题 I am a relatively new IPython Notebook user and I am using IPython 3.2.1. So upfront, my apologies if I did not read some documentation carefully! I am trying to typeset some LaTeX in my Notebook intended for a presentation. I tried to utilize MathJax capabilities better than what's (supposedly) available by default and so tried incorporating other extensions that come with MathJax explicitly. In particular, I tried getting my IPython Notebook to load AMScd.js, AMSsymbols.js and unicode.js

I have the following error. How to fix the following certificate error (ipython)?

和自甴很熟 提交于 2019-12-20 04:12:58
问题 I'm getting the following error when I want to run ipython notebook on my macbook. Does anyone know how to fix this? Could you please help me about it? ERROR:root:Exception in I/O handler for fd 6 Traceback (most recent call last): File "//anaconda/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 346, in start self._handlers[fd](fd, events) File "//anaconda/lib/python2.7/site-packages/tornado/netutil.py", line 167, in accept_handler callback(connection, address) File "//anaconda/lib

IPython change input cell syntax highlighting logic for entire session

戏子无情 提交于 2019-12-20 03:57:12
问题 You can use extensions or display helpers in IPython to make whatever syntax highlighting you'd like on output cells. For some special cell magics, like %%javascript you can also see the input cell itself is rendered with that language's natural syntax highlighting. How can you cause every input cell to be displayed with some chosen, non-Python syntax highlighting (regardless of any magics used on a cell, regardless of whether the cell embodies Python code, some other language). In my case I

Trying to create grouped variable in python

China☆狼群 提交于 2019-12-19 11:42:47
问题 I have a column of age values that I need to convert to age ranges of 18-29, 30-39, 40-49, 50-59, 60-69, and 70+: For an example of some of the data in df 'file', I have: and would like to get to: I tried the following: file['agerange'] = file[['age']].apply(lambda x: "18-29" if (x[0] > 16 or x[0] < 30) else "other") I would prefer not to just do a groupby since the bucket sizes aren't uniform but I'd be open to that as a solution if it works. Thanks in advance! 回答1: It looks like you are

closing a pyqt widget in ipython notebook without using sys.exit()

↘锁芯ラ 提交于 2019-12-19 10:52:50
问题 I am trying to run through some pyqt5 tutorials in the ipython notebook, but have an issue where every second time I run a code block the kernal undergoes a forced restart. Here is the smallest code which causes the problem: import sys from PyQt5.QtWidgets import QApplication, QWidget if __name__ == '__main__': app = QApplication(sys.argv) w = QWidget() w.setWindowTitle('Simple') w.show() sys.exit(app.exec_()) I am running the Ipython3 notebook and python 3, as well as pyqt5, and using Ubuntu

How do I set up default cell magics for every ipython notebook cell?

家住魔仙堡 提交于 2019-12-19 10:28:10
问题 I have an iPython notebook that is completely made up of R cells. At the start of every cell, I have defined my R cell magic as follows: %%R However, is there a way to have just set that as a default for the entire notebook, so I don't have to type it into every cell? 回答1: IRKernel is an R kernel for ipython/jupyter as suggested by @cel. There are lots of other kernels that you can use. 来源: https://stackoverflow.com/questions/30490801/how-do-i-set-up-default-cell-magics-for-every-ipython

IPython Notebook Tab-Complete — Show Docstring

社会主义新天地 提交于 2019-12-19 05:12:42
问题 I just upgraded to IPython 2.0.0 and the behavior of tab-complete seems to have changed for the worse. (Using pyreadline 2.0, which according to this question might matter). Formerly, if I hit TAB after function_name( , IPython would show the docstring for that function. Now, I just see a dropdown list of what I guess is everything in the namespace, including: Error types names of other notebooks in the directory IPython magic functions Other functions I've defined etc. The old behavior was

How to manage and communicate with multiple IPython/Jupyter kernels from a Python script?

本小妞迷上赌 提交于 2019-12-19 02:59:07
问题 I want to mimic the functionality of a notebook server, and instead coordinate the creation/management of different IPython/Jupyter kernels from a central body of logic (i.e. my own Python script). For example, I want to: Define an abstract command e.g. "add(x, y)" Communicate the abstract command to multiple kernels e.g. an IPython kernel and Scala kernel Have each kernel execute the command however they wish Return the result from each kernel to the central body of logic Can anyone point me