API References
SciPy.SciPy
— ModuleA Julia interface module for SciPy
SciPy.cluster
— Constantscipy.cluster module
Examples
You can do k-means clustering using this module:
julia> features = [[ 1.9 2.3];
[ 1.5 2.5];
[ 0.8 0.6];
[ 0.4 1.8];
[ 0.1 0.1];
[ 0.2 1.8];
[ 2.0 0.5];
[ 0.3 1.5];
[ 1.0 1.0]]
9×2 Array{Float64,2}:
1.9 2.3
1.5 2.5
0.8 0.6
0.4 1.8
0.1 0.1
0.2 1.8
2.0 0.5
0.3 1.5
1.0 1.0
julia> whitened = SciPy.cluster.vq.whiten(features)
9×2 Array{Float64,2}:
2.7396 2.91001
2.16284 3.16306
1.15351 0.759134
0.576757 2.2774
0.144189 0.126522
0.288379 2.2774
2.88379 0.632612
0.432568 1.89784
1.44189 1.26522
julia> SciPy.cluster.vq.kmeans(whitened, [whitened[1,:] whitened[3,:]] )
([1.1174670798453024 1.8345740800894272; 2.8837860125040065 0.6326117517549749], 1.073399
3090584457)
SciPy.fft
— Constantscipy.fft module
Examples
You can use FFT (Fast Fourier Transform):
julia> SciPy.fft.fft(exp.(π/8 * collect(1:8)))
8-element Array{Complex{Float64},1}:
68.17385416403044 - 0.0im
1.408601300061675 + 31.248171041435185im
-10.268363617931092 + 15.207165888808841im
-12.695027025520982 + 6.493878653648949im
-13.216494113330363 - 0.0im
-12.695027025520982 - 6.493878653648949im
-10.268363617931092 - 15.207165888808841im
1.408601300061675 - 31.248171041435185im
SciPy.integrate
— Constantscipy.integrate module
Examples
You can compute a definite integral:
julia> f(x) = x^2
f (generic function with 1 method)
julia> SciPy.integrate.quad(f, 0, 4)
(21.333333333333336, 2.368475785867001e-13)
SciPy.io
— Constantscipy.io module
Examples
You can save a MATLAB-style .mat file:
julia> mdic = Dict([("a", 100), ("label", "experiment")])
Dict{String,Any} with 2 entries:
"label" => "experiment"
"a" => 100
julia> SciPy.io.savemat("sample_data.mat", mdic)
SciPy.linalg
— Constantscipy.linalg module
Examples
You can compute the matrix exponential using Pade approximation:
julia> SciPy.linalg.expm(zeros((2,2)))
2×2 Array{Float64,2}:
1.0 0.0
0.0 1.0
SciPy.ndimage
— Constantscipy.ndimage module
Examples
You can compute a multidimensional convolution:
julia> k = [[1 1 1];[1 1 0];[1 0 0]]
3×3 Array{Int64,2}:
1 1 1
1 1 0
1 0 0
julia> a = [[1 2 0 0];
[5 3 0 4];
[0 0 0 7];
[9 3 0 0]]
4×4 Array{Int64,2}:
1 2 0 0
5 3 0 4
0 0 0 7
9 3 0 0
julia> SciPy.ndimage.convolve(a, k, mode="constant", cval=0.0)
4×4 Array{Int64,2}:
11 10 7 4
10 3 11 11
15 12 14 7
12 3 7 0
SciPy.odr
— Constantscipy.odr module
Examples
You can calculate orthogonal distance regression with an exponential model:
julia> x = collect(0.0:5.0);
julia> y = -10.0 .+ exp.(0.5*x);
julia> data = SciPy.odr.Data(x, y)
PyObject <scipy.odr.odrpack.Data object at 0x7fe5fda4ccc0>
julia> data = SciPy.odr.Data(x, y);
julia> odr_obj = SciPy.odr.ODR(data, SciPy.odr.exponential);
julia> output = odr_obj.run();
julia> println(output.beta)
[-10.0, 0.5]
SciPy.signal
— Constantscipy.signal module
Examples
You can compute the Kaiser parameter beta, given the attenuation a:
julia> SciPy.signal.kaiser_beta(65)
6.20426
SciPy.sparse
— Constantscipy.sparse module
Examples
You can do sparse matrix calculation:
julia> A = SciPy.sparse.csc_matrix([[1.0 0.0];
[1.0 2.0]]);
julia> Ainv = SciPy.sparse.linalg.inv(A);
julia> A.dot(Ainv).todense()
2×2 Array{Float64,2}:
1.0 0.0
0.0 1.0
SciPy.special
— Constantscipy.special module
SciPy.__init__
— MethodModule initialization function
SciPy.print_configurations
— MethodPrint configurations:
- Julia version
- Python version
- Python path
- scipy version