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
""" | |
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 |
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
""" | |
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 |
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 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') |
NewerOlder