ipython-notebook

IPython Notebook: Why do not appearing the widgets after installing correctly ipywidgets in DSX?

五迷三道 提交于 2019-12-06 13:49:28
After installing ipywidgets in a Jupiter notebook, DSX (IBM Datascience Experience framework), it doesn't show the widget, just a static stuff or A Jupyter Widget Example: import ipywidgets as widgets widgets.Dropdown( options = { 'One': 1, 'Two': 2, 'Three': 3 }, value = 2, description = 'Number:', ) Result: A Jupiter Widget I have tried several versions of !jupyter nbextension enable --py widgetsnbextension --sys-prefix based on http://ipywidgets.readthedocs.io/en/latest/user_install.html , but I still got the same error message: PermissionError: [Errno 13] Permission denied: '/usr/local/src

figure caption centering in nbconvert?

无人久伴 提交于 2019-12-06 12:26:13
问题 I have cells underneath figures in an ipython notebook that contain figure caption text. I would like them to be centre('center')-aligned. I use "< center >" in the markdown, which gives exactly the appearance I'm after in the notebook. But when nb-converting to latex, the text gets shunted over to the left. So is there a way to get nbconvert to recognize text alignment in markdown cells when converting to latex? Thanks. 回答1: You have actually asked two different questions: is there a way to

convert ipython notebook to mediawiki

本小妞迷上赌 提交于 2019-12-06 11:58:55
I would like to convert an ipython notebook to mediawiki markup. I had two ideas how to do that: Customize an export for the nbconvert tool. Export to LaTeX first and then use pandoc to convert it to mediawiki markup. I couldn't find anything on the first option. The problem for the second option is that LaTeX output puts in a lot of custom commands which are not converted into <source lang='python'> ... </source> tags correctly. Does anybody have a good idea? you can probably pitch-in in issue 4058 nbconvert: Wikipedia (mediawiki) output . We'll be happy to guide you if you want to learn how

Argparse in iPython notebook: unrecognized arguments: -f

為{幸葍}努か 提交于 2019-12-06 08:04:34
问题 I am trying to pass a .py file to ipython notebook environment. I have never had to deal directly with argparse before. How do I rewrite the main() function? I tried to delete the line of def main(): and keep the rest of the code. But args = parser.parse_args() " returned an error: ipykernel_launcher.py: error: unrecognized arguments: -f. And when I run . %tb: showing this def main(): parser = argparse.ArgumentParser() parser.add_argument('--data_dir', type=str, default='data/tinyshakespeare'

Changing the font in iPython notebook markdown cells

三世轮回 提交于 2019-12-06 07:32:11
I just wanted to change the default font in Ipython (1.0.0) notebook markdown cells to something else, and tried doing this using style tags in a markdown cell instead of going through the path of creating a custom.css. I do not know CSS, and my needs are very minimal. After some research, I found the following code snippet: <style> div.text_cell_render { font-family: "Times New Roman", serif; ... } </style> I applied the above CSS code to a markdown cell, however the font in the other markdown text cells did not change. Do I have to turn something on first? Below is how it looks like: On

How to run an ipython notebook in parallel just changing some parameter values?

微笑、不失礼 提交于 2019-12-06 06:38:09
问题 I have an IPython notebook with multiple cells that I want to run several times in parallel with only a difference on some parameters (which are defined inside on of the notebook's cells). What is the easiest way of doing it? I have a workstation with 12 cores. whenever I run a notebook it only uses one of the cores. I want to use the other cores to run the exact same notebook but with some modifications of some parameters. Is it possible? Thank you very much 回答1: I actually then found a way

Create subplots in Matplotlib in a loop?

不问归期 提交于 2019-12-06 06:09:44
问题 I am using this code which provides nice plots one after the next (using IPython-notebook & Pandas) for subsm in subsl: H7, subsm = sumsubdesc2(table, subsm) ax1=H7.plot() plt.title('Rolling 4q mean %s'%(subsm)) ax1.set_title('Rolling 4q mean %s'%(subsm)) ax1.set_ylim(100000,600000) I'd like to get the plots "2up" one next to the next for 3 rows total (5 subplots) can't figure out how to handle that since all the subplot examples seem to be for subplotting ether the data or specific plots and

iPython notebook on Mac OSX Yosemite: no module named jinja2, even if it's installed

蓝咒 提交于 2019-12-06 05:47:36
I am trying to run iPython notebook on OSX Yosemite. I have installed everything via pip install ipython[all] and I see mattia:~ mattiaspeziali$ pip freeze backports.ssl-match-hostname==3.4.0.2 certifi==14.5.14 docutils==0.12 gnureadline==6.3.3 ipython==2.3.1 Jinja2==2.7.3 MarkupSafe==0.23 nose==1.3.4 numpy==1.8.2 numpydoc==0.5 pandas==0.14.1 Pygments==2.0.1 pyzmq==14.4.1 Sphinx==1.2.3 tornado==4.0.2 vboxapi==1.0 However, jinja2 seems not installed properly: mattia:~ mattiaspeziali$ ipython notebook Traceback (most recent call last): File "/usr/local/bin/ipython", line 11, in <module> sys.exit

Plotly import error for exceptions module

荒凉一梦 提交于 2019-12-06 05:19:05
问题 I have searched all over and couldn't find the solution to this problem. I am trying to import plotly in Jupyter Notebook with following code and getting the following error respectively Code: import sys print(sys.path) sys.path.append('/usr/local/lib/python2.7/dist-packages') import plotly Error: --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-3-b41540b5e198> in <module>() 3 sys.path.append('/usr/local

IPython notebook read string from raw text cell

妖精的绣舞 提交于 2019-12-06 04:32:27
问题 I have a raw text cell in my IPython notebook project. Is there a way to get the text as a string with a build in function or something similar? 回答1: My (possibly unsatisfactory) answer is in two parts. This is based on a personal investigation of iPython structures, and it's entirely possible I've missed something that more directly answers the question. Current session The raw text for code cells entered during the current session is available within a notebook using the list In . So the