A one or two line description.
Enables you to do...
# Import C# CLR interface and system | |
import clr, sys | |
# Add C# Library Paths and add references via CLR module | |
sys.path.append('C:\\Program Files (x86)\\Accord.NET\\Framework\\Release\\net40') | |
sys.path.append('C:\\Program Files (x86)\\AForge.NET\\Framework\\Release') | |
clr.AddReference('System.Core') | |
clr.AddReference('AForge.Math') | |
clr.AddReference('Accord.Statistics') | |
clr.AddReference('System.Linq') |
""" | |
Initiating a 9000x9000 triangular matrix and applying XOR across all elements | |
""" | |
""" Using ufunc without at() """ | |
%%timeit | |
a = np.tri(9000,dtype=int) | |
a = np.bitwise_xor(a,1) | |
# 1 loops, best of 3: 373 ms per loop |
""" | |
Test how to composite matrices with 'where' | |
Test generator builds random incrementing matrices | |
The compositor takes output from this generator and performs the compositing. | |
Display an image map of the matrices | |
""" | |
import numpy as np | |
from matplotlib import pyplot as pl |
def elim(row, minus_row, scale, n=3): | |
m = np.eye(n) | |
m[row, minus_row] = -scale | |
return m |
def scramble2Decrypt(cipherText): | |
halfLength = len(cipherText) // 2 | |
oddChars = cipherText[:halfLength] | |
evenChars = cipherText[halfLength:] | |
plainText = "" | |
for i in range(halfLength): | |
plainText = plainText + evenChars[i] | |
plainText = plainText + oddChars[i] | |
if len(oddChars) < len(evenChars): | |
plainText = plainText + evenChars[-1] |
# Initialize two signals with arbitrary length | |
n, m = 5, 7 | |
convolution_length = n+m-1 | |
u = np.random.randint(0, 255, n) | |
v = np.random.randint(0, 255, m) | |
# Convolve the two signals | |
cv = sp.signal.convolve(u, v) |
import base64 | |
# Create a string and encode to bytes | |
s = 'Convert me to base64!' | |
sb = s.encode('utf-8') | |
# Take bytes and encode to base64 string | |
sb64 = base64.b64encode(sb).decode() | |
# Q29udmVydCBtZSB0byBiYXNlNjQh |
import numpy as np | |
A = np.eye(20) | |
A @ A # `@` is the matrix multiplication operator |
Overfitting happens in education; it's called specialization. |