ipython

dask, joblib, ipyparallel and other schedulers for embarrassingly parallel problems

强颜欢笑 提交于 2019-12-24 13:51:41
问题 This is a more general question about how to run "embarassingly paralllel" problems with python "schedulers" in a science environment. I have a code that is a Python/Cython/C hybrid (for this example I'm using github.com/tardis-sn/tardis .. but I have more such problems for other codes) that is internally OpenMP parallalized. It provides a single function that takes a parameter dictionary and evaluates to an object within a few hundred seconds running on ~8 cores ( result=fun(paramset,

Ipython Notebook & Matplotlib: How to wrap a plot within a html div?

ε祈祈猫儿з 提交于 2019-12-24 12:51:59
问题 I want to add some css to part of my plot, (specifically, I want to set float:left ). How can I produce the plot within a div, so I can use css to control its layout? For example, for code def simple_plot(ax = None): if ax is None: fig, ax = plt.subplots() a = [1,2,3,4] b = [3,4,5,6] plt.plot(a, b,'-', color='black') simple_plot() The default output html in Ipython Notebook is <div class="output_area"> <div class="prompt"></div> <div class="output_subarea output_png"> <img src="data:image/png

Bad Interpreter: No such file or directory error when launching iPython with Anaconda

…衆ロ難τιáo~ 提交于 2019-12-24 12:44:30
问题 My ipython was working fine until I installed a new IDE and accidentally changed some path settings. Now, when I try to launch ipython from terminal I get: -bash: /Users/JohnSmith/anaconda/bin/ipython: /Users/JohnSmith/anaconda/python.app/Contents/MacOS/python: bad interpreter: No such file or directory How do I change my path/local environment settings back so that it works? 回答1: It seems that uninstalling and re-installing Anaconda was the easiest solution (after several hours of playing

Python: how to control namespace after an unhandled exception?

偶尔善良 提交于 2019-12-24 10:04:07
问题 Is there any way to control which namespace you end up in after an unhandled exception? For example, if I'm at an ipython prompt and I go run blah.py on a file with these contents: def spam(): ham = 'ham' crash = 1/0 eggs = 'eggs' if __name__ == '__main__': foo = 'foo' spam() it crashes out obviously but returns me to an ipython prompt, with foo now in the namespace (and any previously existing foo is now overwritten with 'foo' ). But no ham . For some post mortem inspection, it is often the

Replaces spaces with NAN in pandas dataframe

纵饮孤独 提交于 2019-12-24 08:49:59
问题 I have a pandas dataframe with three columns: Name Name2 DateTime 2016-06-10 05:22 2016-06-10 05:23 2016-06-10 14:25 Guest Guest1 2016-06-10 15:32 I have to replace empty spaces with NAN. So AccountName and AccountName2 of rows 1,2,3 and 4 should be NAN. I tried the below statement: df3['Name'] = df3['Name'].replace(r'[^\s+]',np.nan, regex=True) But since I have white spaces after "Guest " in Name, all 5 rows get replaced with NAN. Edit: This is our actual data. Name Name2 DateTime \t\t-\r\n

ctypes dll call works in ipython but not in regular python

£可爱£侵袭症+ 提交于 2019-12-24 07:27:08
问题 NOTE: My original question was closed for being off-topic, but I am resubmitting this with an answer for any who might run into a similar issue My system details: Windows 10 64-bit Python 3.6 64-bit I unfortunately cannot share data files or the dll due to confidentiality, but I am using a vendor provided dll (written in Delphi) to read binary instrument data files. I also do not have access to the source code, nor any entitlement to detailed coding support. A sample script called

Jupyter / Ipython Notebook Html Page View

一个人想着一个人 提交于 2019-12-24 07:19:12
问题 I installed Ipython Notebook but html page does not seem correct. Tabs and links do not seem correctly installled. You may see the screenshot samples as attached. Can anyone advise how I can fix this ? 回答1: I am sure, it is just internet connection trouble, not IPython (Jupyter) Notebook. But chech up information about Browser Compatibility. Browser Compatibility. The IPython notebook is officially supported on the following browsers: Chrome ≥ 13, Safari ≥ 5, Firefox ≥ 6. The is mainly due to

The Cython module is not an IPython extension

て烟熏妆下的殇ゞ 提交于 2019-12-24 06:48:26
问题 When trying to load Cython extension from my Jupiter notebook %load_ext Cython I get the below message: The Cython module is not an IPython extension I did not have this problem a couple of weeks ago, when I wrote a Cython extension on my nb. I have tried to upgrade ipython and cython both from my regular environment (I am using a Mac running 10.11) and from Anaconda, with no success. Any tips? Thanks a lot! 回答1: Cython is not an IPython extension, so %load_ext won't work on it. You can still

Error while using Graphlab Create Jupyter

回眸只為那壹抹淺笑 提交于 2019-12-24 06:47:12
问题 I have recently upgraded the Graph Lab create version that I had. While running codes using the Jupyter console I came up with the following errors: from __future__ import division import graphlab import math import string **Error: ACTION REQUIRED: Dependencies libstdc++-6.dll and libgcc_s_seh-1.dll not found. 1. Ensure user account has write permission to C:\Anaconda3\envs\gl-env\lib\site-packages\graphlab 2. Run graphlab.get_dependencies() to download and install them. 3. Restart Python and

script that adds packages to sys.path import as expected when run from ipython but throw exception when the script is run from python

元气小坏坏 提交于 2019-12-24 05:28:12
问题 I am a perplexed Python enthusiast. I posted What else can I do to troubleshoot a package not importing in python yet imports in ipython while in a virtualenv? thinking that I was having a problem with my virtualenv. Some more troubleshooting has revealed this is probably not the case. I would appreciate any insight or troubleshooting tips so that I can get on with package development. Thank you in advance! Synopsis of my problem on Ubuntu 14.04.1 LTS system with Python 2.7.6.: I have a