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
"""Base class for sparse matrice with a .data attribute | |
subclasses must provide a _with_data() method that | |
creates a new matrix with the same sparsity pattern | |
as self but with a different data array | |
""" | |
__all__ = [] |
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
from enable.api import Component, ComponentEditor | |
from enable.tools.api import DragTool | |
from traits.api import HasTraits, Instance | |
from traitsui.api import View, UItem | |
class MyDragTool(DragTool): | |
end_drag_on_leave = True |
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 | |
from scipy.stats.distributions import gamma_gen | |
class erlang_gen(gamma_gen): | |
def _argcheck(self, a): | |
good = (a > 0) & (np.floor(a) == a) | |
if not np.all(good): |
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 warnings | |
import numpy as np | |
from scipy.stats.distributions import gamma_gen, rv_continuous | |
class erlang_gen(gamma_gen): | |
"""An Erlang continuous random variable. | |
%(before_notes)s |
This file has been truncated, but you can view the full file.
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
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................KFKFKK.K.....K...........K...KKKSF..KSSKKKKKSK..K...S..SFKKKSKKKKKKK..K........................................................ | |
====================================================================== | |
FAIL: test_mpmath.TestSystematic.test_chebyt_int | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/warren/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest | |
self.test(*self.arg) | |
File "/home/warren/a |
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
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................K.K..F.K.....K...........K...KKKS...KSSKKKKKSK..K...S..S.KKKSKKKKKK............................................................. | |
====================================================================== | |
FAIL: test_mpmath.TestSystematic.test_ci | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/warren/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest | |
self.test(*self.arg) | |
File "/home/warren/anaconda |
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
# create_sample24.py | |
# Author: Warren Weckesser | |
# License: BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause) | |
import numpy as np | |
import wave | |
def create_sample(): | |
# 27 bytes (1 channel, 9 frames, 3 bytes per frame) |
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
# wavio.py | |
# Author: Warren Weckesser | |
# License: BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause) | |
import wave | |
import numpy as np | |
def _wav2array(nchannels, sampwidth, data): | |
"""data must be the string containing the bytes from the wav file.""" |
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 | |
from scipy.special import pdtrik, gammaincc | |
import matplotlib.pyplot as plt | |
num_p = 41 | |
num_lam = 21 | |
p = np.linspace(0, 1, num_p).reshape(-1,1) | |
#p = np.linspace(0.99999, 1, num_p).reshape(-1,1) | |
lam = np.logspace(-20, 0, num_lam) |
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 | |
from scipy.integrate import ode | |
import matplotlib.pyplot as plt | |
def func(t, y, c): | |
return c.dot(y) | |
def jac(t, y, c): | |
return c |
OlderNewer