Skip to content

Instantly share code, notes, and snippets.

View takluyver's full-sized avatar

Thomas Kluyver takluyver

View GitHub Profile
@takluyver
takluyver / gist:1118274
Created August 1, 2011 14:49
IPython Qtconsole crash report
***************************************************************************
IPython post-mortem report
{'commit_hash': '464280a',
'commit_source': 'installation',
'ipython_path': 'c:\\python26\\lib\\site-packages\\IPython',
'ipython_version': '0.11',
'os_name': 'nt',
'platform': 'Windows-XP-5.1.2600-SP2',
@takluyver
takluyver / gist:1281034
Created October 12, 2011 11:55
Plotting pandas columns
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
/home/thomas/Experiments/Emergence depth/<ipython-input-5-1c9d8c0f3fd8> in <module>()
----> 1 plot(soy_w['Depth'])
/home/thomas/code/virtualenvs/mpl/lib/python2.7/site-packages/matplotlib/pyplot.pyc in plot(*args, **kwargs)
2284 ax.hold(hold)
2285 try:
-> 2286 ret = ax.plot(*args, **kwargs)
2287 draw_if_interactive()
@takluyver
takluyver / gist:1446761
Created December 8, 2011 11:24
IPython issue 1123 traceback
ValueError Traceback (most recent call last)
/home/thomas/code/virtualenvs/ipy-trunk/<ipython-input-1-709e57e53f13> in <module>()
----> 1 get_ipython().magic(u"run 'a \\' b.py'")
/home/thomas/code/virtualenvs/ipy-trunk/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s, next_input)
1987 self._magic_locals = sys._getframe(1).f_locals
1988 with self.builtin_trap:
-> 1989 result = fn(magic_args)
1990 # Ensure we're not keeping object references around:
@takluyver
takluyver / gist:1449027
Created December 8, 2011 22:40
Unified setup for IPython diff
diff --git a/setup2.py b/setup2.py
index f065fc8..f405da5 100755
--- a/setup2.py
+++ b/setup2.py
@@ -20,17 +20,20 @@ requires utilities which are not available under Windows."""
#-----------------------------------------------------------------------------
# Minimal Python version sanity check
#-----------------------------------------------------------------------------
+from __future__ import print_function
@takluyver
takluyver / gist:2204230
Created March 26, 2012 09:51
rpy2 setup.py change for Python 3.
r_exec = os.path.join(r_home, 'bin', 'R')
# Changed ---------------------------------------
import subprocess
rp = subprocess.check_output([r_exec, '--version'], stderr=subprocess.STDOUT).decode('ascii').splitlines()
rversion = rp[0]
# Twist if 'R RHOME' spits out a warning
if rversion.startswith("WARNING"):
rversion = rp[1]
# End of changed section ------------------------
m = re.match('^R ([^ ]+) ([^ ]+) .+$', rversion)
@takluyver
takluyver / gcj_template.ipynb
Created April 13, 2012 10:49
Google Codejam: IPython notebook template
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@takluyver
takluyver / gist:2413637
Created April 18, 2012 13:43
IPython.lib.deepreload traceback
In [12]: dreload(B, exclude=['A'])
Reloading io
Reloading _io
Reloading os
Reloading sys
Reloading errno
Reloading posix
Reloading posixpath
Reloading stat
Reloading genericpath
@takluyver
takluyver / bes.csl
Created April 30, 2012 11:33
BES citation style
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US">
<info>
<title>British Ecological Society</title>
<id>http://www.zotero.org/styles/british-ecological-society</id>
<link href="http://www.zotero.org/styles/british-ecological-society" rel="self"/>
<link href="http://www.functionalecology.org/view/0/authorGuideline.html" rel="documentation"/>
<author>
<name>Johan Asplund</name>
<email>asplundj@gmail.com</email>
@takluyver
takluyver / results.log
Created May 4, 2012 20:13
IPython test log
.............................................
----------------------------------------------------------------------
Ran 45 tests in 0.094s
OK
/home/thomas/.ipy_pr_tests/venv-python3.1/lib/python3.1/site-packages/ipython-0.13.dev-py3.1.egg/IPython/nbformat/v3/tests/nbexamples.py:13: DeprecationWarning: encodestring() is a deprecated alias, use encodebytes()
png = encodestring(os.urandom(5))
/home/thomas/.ipy_pr_tests/venv-python3.1/lib/python3.1/site-packages/ipython-0.13.dev-py3.1.egg/IPython/nbformat/v3/tests/nbexamples.py:14: DeprecationWarning: encodestring() is a deprecated alias, use encodebytes()
jpeg = encodestring(os.urandom(6))
...................................................................................................................................................................................................S.....................S........................................................K.........
@takluyver
takluyver / results.log
Created May 4, 2012 20:12
IPython test log
**********************************************************************
IPython test group: IPython.config
.............................................
----------------------------------------------------------------------
Ran 45 tests in 0.053s
OK
**********************************************************************
IPython test group: IPython.core
...........................................................................................................................................................................................................................................................................................................................................................................................................K.........