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
### MATPLOTLIBRC FORMAT | |
# This is a sample matplotlib configuration file - you can find a copy | |
# of it on your system in | |
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it | |
# there, please note that it will be overridden in your next install. | |
# If you want to keep a permanent local copy that will not be | |
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux | |
# like systems) and C:\Documents and Settings\yourname\.matplotlib | |
# (win32 systems). |
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
def hard_work(n): | |
""" A naive factorization method. Take integer 'n', return list of | |
factors. | |
""" | |
# Do some CPU bond work here | |
if n < 2: | |
return [] | |
factors = [] | |
p = 2 |
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
In [1]: from sympy import symbols | |
In [2]: x, y = symbols('x, y') | |
In [3]: c, d = symbols('c, d') | |
In [4]: x ** 2 + 2 * y | |
Out[4]: | |
2 | |
x + 2⋅y |
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 | |
def filter2d(image, filt): | |
M, N = image.shape | |
Mf, Nf = filt.shape | |
Mf2 = Mf // 2 | |
Nf2 = Nf // 2 | |
result = numpy.zeros_like(image) | |
for i in range(Mf2, M - Mf2): | |
for j in range(Nf2, N - Nf2): |
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 matplotlib | |
matplotlib.use('webagg') | |
import numpy as np | |
from scipy.special import binom | |
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
function v = colonop(a,d,b) | |
% COLONOP Demonstrate how the built-in a:d:b is constructed. | |
% | |
% v = colonop(a,b) constructs v = a:1:b. | |
% v = colonop(a,d,b) constructs v = a:d:b. | |
% | |
% v = a:d:b is not constructed using repeated addition. If the | |
% textual representation of d in the source code cannot be | |
% exactly represented in binary floating point, then repeated | |
% addition will appear to have accumlated roundoff error. In |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.