ipython

iPython (python 2) - ImportError: No module named model_selection

无人久伴 提交于 2019-12-23 15:38:21
问题 iPython Notebook Python 2 Complaining about this line: from sklearn.model_selection import train_test_split Why isn't model selection working? 回答1: In order to remedy this issue, you need to first find out if you are importing the actual sklearn package, and not just some script with the name sklearn.py saved somewhere in your working directory. The way Python imports modules is somewhat similar to the way it finds variables in its namespace ( Local , Enclosed , Global , Built-in ). In this

Fail Jupyter Notebook installation on clean Ubuntu 14.04 LTS

限于喜欢 提交于 2019-12-23 15:28:44
问题 How do I install develompment version of Jupyter Notebook? $ wget https://bootstrap.pypa.io/get-pip.py $ sudo python get-pip.py $ sudo pip install virtualenv $ cd ~ $ virtualenv local/python/jupyter $ source local/python/jupyter/bin/activate $ git clone --recursive https://github.com/ipython/ipython.git $ cd ipython $ pip install -e ".[notebook]" Could not find a version that satisfies the requirement jupyter-notebook (from ipython==4.0.0.dev0) (from versions: ) Some externally hosted files

Animate a ScatterPlot with PyPlot

依然范特西╮ 提交于 2019-12-23 15:19:09
问题 I'm trying to plot the movement of particles with pyplot. The problem is that I can't figure out how to create the animation. Here is the notebook : http://nbviewer.ipython.org/gist/lhk/949c7bf7007445033fd9 Apparently the update function doesn't work properly, but the error message is too cryptic for me. What do I need to change ? Do you have a good tutorial on animation with pyplot ? 回答1: As @s0upa1t comments you should have figure handle as the first argument to animation. The criptic error

Reading the stdout from slave nodes with ipcluster

人走茶凉 提交于 2019-12-23 13:22:42
问题 I've set up a cluster using ipcluster start --n=8 then accessed it using from IPython.parallel import Client c=Client() dview=c[:] e=[i for i in c] I'm running processes on the slave nodes (e[0]-e[7]) which take a lot of time and I'd like them to send progress reports to the master so I can keep an eye on how far through they are. There are two ways I can think to do this but so far I haven't been able to implement either of them, despite hours of trawling through question pages. Either I

Change the size of the label in an IPython notebook widget

拥有回忆 提交于 2019-12-23 12:40:30
问题 This is really a trivial problem, but it is still annoying. I'm writing a tool to allow a user to set a bunch of numerical parameters for an analysis in the IPython notebook. I've set it up as a bunch of FloatTextWidget s in a ContainerWidget . They have rather long labels like "Number of Posture Points" or "Background Disk Radius". They don't line up nicely. This is because of the length: as explained on this page, "The label of the widget has a fixed minimum width. The text of the label is

how does IPython magics work

怎甘沉沦 提交于 2019-12-23 12:34:17
问题 ipthon-sql is an extension of ipython, I first install it by pip install ipython-sql the project is here: https://github.com/catherinedevlin/ipython-sql and my problem is: when I enter %load_ext sql and press SHIFT+ENTER, what's the detailed procedure of IPython to execute this magic sentence? thanks ... 回答1: When you run any code in the notebook, an execute_request is sent via the notebook server, to a 'kernel', a process which executes your code. When the kernel receives your code, it runs

IPython, semicolon to suppress output does not work

旧时模样 提交于 2019-12-23 12:33:02
问题 In the documentation at http://ipython.org/ipython-doc/dev/interactive/tips.html it says to put a semicolon (;) at the end of a command to suppress its output. This does not seem to work in my case as even a >>> \>>> print('Hello'); --> 'Hello' Do I have the wrong idea of output suppression or is this a bug? This is especially annoying when working in pudb, as it flashes horribly in my case as I press 'next' or 'step into'. P.S the output is neither on my ubuntu ipython 0.10 nor osx lion

how to define functions in ipython configuration file?

回眸只為那壹抹淺笑 提交于 2019-12-23 12:17:04
问题 Using ipython 0.11 if I type a function definition, like def f(s): print s then I can use that function in that ipython session, but I don't know how to define that in the ipython_config.py file. If I just type the function definition in the file and try to use the function it it undefined. Any idea? 回答1: Two answers here: First, for super simple functions like the one above, you can define them in exec_lines , e.g.: c.InteractiveShellApp.exec_lines = [ "def f(s): print s" ] (you can define

IPython on wxPython

走远了吗. 提交于 2019-12-23 12:02:03
问题 I have been trying to find a way to have an IPython Shell in an wx.Frame . Searching around in the library code or Google wxPython based IPython widget ipython shell wxpython haven't helped me much either. Is there any widget that IPython provides that can be used with wx, to integrate an IPython shell into my Frame ?? 回答1: According to the IPython docs, there is a wxPython frontend: http://ipython.org/ipython-doc/rel-0.10.2/html/install/install.html However, I can't really tell if that's

How do I upgrade kernmagic to fix this ipython error?

*爱你&永不变心* 提交于 2019-12-23 11:01:14
问题 I recently upgraded my Enthought Python distribution with sudo easy_install -U ipython However, when I start up ipython with the ipython command, I get an error: David-Faux-MacBook-Air:core davidfaux$ ipython Python 2.7.2 |EPD 7.2-2 (32-bit)| (default, Sep 7 2011, 09:16:50) Type "copyright", "credits" or "license" for more information. IPython 0.13.1 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help