This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
""" Interactive study of an AR(2) auto-regressive filter/process. | |
AR(2) process definition : X_k = a_1 X_{k-1} + a_2 X_{k-2} + Z_k | |
Interactive choice : | |
choose graphically the two coefficients (a1, a2) of the filter | |
by clicking and dragging the red disc on the (a1, a2) plane. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
""" Terminal Here.py | |
Python script which opens a gnome-terminal in the current Nautilus directory. | |
This 'Terminal Here' script should work with spaces and with Unicode characters | |
in the path (at least, it is meant to work). | |
Script tested with Python 2.7 (2.5 - 2.6 should be fine as well) | |
This file should be dropped in the "~/.gnome2/nautilus-scripts" directory, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Change the appearance of the plotted line depending on the amount of zoom. | |
Line properties changed include: line width, line color and marker type | |
Code derived from the clippedline example | |
http://matplotlib.sourceforge.net/examples/pylab_examples/clippedline.html | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.lines import Line2D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
# Creates big x and y data: | |
N = 10**7 | |
t = np.linspace(0,1,N) | |
x = np.random.normal(size=N) | |
# Create a plot: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
""" Shake an image | |
in relation to the discussion about xkcd-style graphs on matplotlib-users ML | |
ref: http://mathematica.stackexchange.com/questions/11350/xkcd-style-graphs | |
Pierre Haessig — October 2012 | |
""" | |
from os.path import splitext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as n | |
import random as r | |
import pylab as p | |
DIRS = ['up', 'right', 'down', 'left'] | |
def new_guy(seed=0): | |
r.seed(seed) | |
dna = [[r.choice(DIRS), | |
r.randint(1, 40), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hour | power | |
---|---|---|
00 | 5.88 | |
01 | 5.51 | |
02 | 5.94 | |
03 | 6.84 | |
04 | 6.10 | |
05 | 5.80 | |
06 | 6.26 | |
07 | 4.64 | |
08 | 3.71 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Saving and loading Traits in a text file format | |
using a minimal amount of formatting and parsing code. | |
Pierre Haessig -- September 2013 | |
''' | |
from traits.api import HasTraits, Float | |
class Person(HasTraits): | |
weight = Float(75.0) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Type=Service | |
X-KDE-ServiceTypes=KonqPopupMenu/Plugin | |
MimeType=inode/directory; | |
Actions=openIPythonHere; | |
X-KDE-AuthorizeAction=shell_access | |
[Desktop Action openIPythonHere] | |
# TryExec=ipython | |
Exec=cd %f; ipython qtconsole --pylab |
OlderNewer