ipython

How to reduce Ipython parallel memory usage

旧时模样 提交于 2019-12-11 19:34:24
问题 I'm using Ipython parallel in an optimisation algorithm that loops a large number of times. Parallelism is invoked in the loop using the map method of a LoadBalancedView (twice), a DirectView 's dictionary interface and an invocation of a %px magic. I'm running the algorithm in an Ipython notebook. I find that the memory consumed by both the kernel running the algorithm and one of the controllers increases steadily over time, limiting the number of loops I can execute (since available memory

ipython notebook not launching

若如初见. 提交于 2019-12-11 19:27:55
问题 I cannot get ipython notebook to launch. I used the command "ipython notebook" in command prompt but I got an error saying that "ipython" is not recognized as a command. I have Python 3.3 and ipython 1.2.1. This command works on my other Windows machine and I used the same process to install ipython. The only difference is that I am using Python 2.7 on my other Windows machine. I feel like there is a really simple fix or I have made a silly error. Any ideas? Edit: I tried ThomasK's suggestion

Cannot convert ipython notebook to pdf

馋奶兔 提交于 2019-12-11 19:27:47
问题 I've got some trouble when converting a notebook to a pdf. First I tryed doing it in the webb-app and I got: nbconvert failed: PDF creating failed Then I tried running the pdf-converter from the cmd and it gave me a long error message but the following seems to be the most important: ! Missing $ inserted. <inserted text> $ l.291 ... Till att börja med har vi \$\frac{1}{2} ? ! Emergency stop. <inserted text> $ l.291 ... Till att börja med har vi \$\frac{1}{2} ! ==> Fatal error occurred, no

Pandas: Trouble implementing Panel OLS

大憨熊 提交于 2019-12-11 19:15:58
问题 I'm having a little bit of a difficult time understanding how to implement the Panel OLS in pandas. I have received help on this topic and I thought I was understanding the situation. Now that I am trying to implement I am having difficulty. Below is my data: url='https://raw.githubusercontent.com/108michael/ms_thesis/master/crsp.dime.mpl.df.1' df=pd.read_csv(url, usecols=(['date', 'cid', 'log_diff_rgdp', 'billsum_support', \ 'years_exp', 'leg_totalbills', 'log_diff_rgdp', 'unemployment',

debugging invalid syntax error iPython

ⅰ亾dé卋堺 提交于 2019-12-11 17:58:21
问题 I am greeted with the following syntax error after I execute the program thanks thkang from this post You entered: ./# Expanded to: ./# ================= File "./largestoddxyz.py", line 43 else: #x and z are even ^ SyntaxError: invalid syntax Here is the code: I am new to using Python and tried to fix the issue, but unfortunately, I wasn't able to. Hopefully someone here can help me. #!/usr/bin/env python # This program exmamines variables x, y, and z # and prints the largest odd number among

IPython won't capture some command outputs (e.g., ack)

微笑、不失礼 提交于 2019-12-11 17:51:33
问题 I don't understand why IPython does not assign the result of some system command to python variables. This seems to constantly happen to me to the ack and ag executables For example, the following command produces output: In [1]: !ack --nocolor foo bar 1:foo However, whenever I save that result to a variable, I get an empty output In [2]: out=!ack --nocolor foo In [3]: out Out[3]: [] I get this problem even when I try all sorts of hacks: In [4]: out=!ack --nocolor foo > tmp; sleep 1; cat tmp

Strange module reload behavior in spyder or IPython

落爺英雄遲暮 提交于 2019-12-11 17:46:11
问题 I have an issue re-running a script in spyder, which dynamically tabulates some of its own attributes. Here is a minimal example that is representative of what I am doing. I have a source script that I run with the normal Run (F5) command. It runs in the same directory that it lives in: runfile('C:/some/path/test.py', wdir='C:/some/path') test.py import sys def x(): pass def y(): pass x.add = y.add = True if __name__ == '__main__': a = [obj for obj in tuple(sys.modules[__name__].__dict__

numpy version creating issue. python 2.7 already installed

安稳与你 提交于 2019-12-11 17:18:21
问题 Getting few "package missing" errors while installing ipython on High Sierra. matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible. 回答1: I just met the same problem. It's a issue about numpy preinstall in Python has a version number issue(required >=1.5, but found 1.8.0rc1). Try running brew install python2 to upgrade your python which may solve this issue. 回答2: Simple solution provided by The Matplotlib development team: https://matplotlib.org/faq

How to write html inside IPython Dialog box?

感情迁移 提交于 2019-12-11 15:18:59
问题 How can I write html as html (not as HTML String) inside IPython Dialog? For example: I have a Ipython UI Extension that shows a Dialog box require( ["base/js/dialog"], function(dialog) { dialog.modal({ title: 'Hello world', body: ?? , buttons: { 'schedule': {} } }); } ); Now inside body of the dialog box, I want to show following HTML content. <label>Quick Schedule</label><br /> <a class="btn btn-primary" onclick="schedule = '@reboot'; job_string();">Startup</a> <a class="btn btn-primary"

Can I prevent Spyder from displaying inline images temporarily?

纵饮孤独 提交于 2019-12-11 15:14:36
问题 In the Spyder IDE, I want to keep the inline console plotting (I don't want separate windows to spawn for each plot), but I want to programmatically disable plotting, i.e. in different cells. In my workflow I need to plot a few simple graphs, and then generate figures and save them as video frames (many thousands). My frames are created by loading a jpg image, and then overlaying some annotation i.e.; for jpg_path in path_list: img = mpl.image.imread(jpg_path) ax.imshow(img) ax.text(etc...)