Multiple dispatch
En un notebook se puede hacer
Hay múltiples paquetes dentro de JuliaIO
Para sacar datos a un archivo, es habitual crear un Dictionary
Dict{Any, Any} with 4 entries:
"unvector" => [1, 2, 3]
"b" => 2
"mivariable" => 1
1 => "mi variable aquí"
Dates.jl es parte de Standard Library
El problema de zonas horarias es muy difícil Vídeo de Computerphile
FileIO aims to provide a common framework for detecting file formats and dispatching to appropriate readers/writers. The two core functions in this package are called load and save, and offer high-level support for formatted files (in contrast with julia’s low-level read and write). To avoid name conflicts, packages that provide support for standard file formats through functions named load and save are encouraged to register with FileIO.
JLD2 saves and loads Julia data structures in a format comprising a subset of HDF5, without any dependency on the HDF5 C library. JLD2 is able to read most HDF5 files created by other HDF5 implementations supporting HDF5 File Format Specification Version 3.0 (i.e. libhdf5 1.10 or later) and similarly those should be able to read the files that JLD2 produces. JLD2 provides read-only support for files created with the JLD package.
Para gestionar archivos JSON.
Para leer archivos de MATLAB.
Data manipulation, storage, and I/O in Julia
DataFrames.jl provides a set of tools for working with tabular data in Julia. Its design and functionality are similar to those of pandas (in Python) and data.frame, data.table and dplyr (in R), making it a great general purpose data science tool.
DataFrames.jl plays a central role in the Julia Data ecosystem, and has tight integrations with a range of different libraries. DataFrames.jl isn’t the only tool for working with tabular data in Julia – as noted below, there are some other great libraries for certain use-cases – but it provides great data wrangling functionality through a familiar interface.
Dict{String, Vector} with 2 entries:
"first name" => ["Rohit", "Rahul", "Akshat"]
"customer age" => [15, 20, 25]
Es parte de Standard Library
tr(A) = 3
det(A) = 104.0
inv(A) =
3×3 Matrix{Float64}:
-0.451923 0.211538 0.0865385
0.365385 -0.192308 0.0576923
0.240385 0.0576923 -0.0673077
La sintaxis para sistemas es la habitual
LU permite exportar L, U y vector de permutaciones, o matriz de permutaciones
LU{Float64, Matrix{Float64}, Vector{Int64}}
L factor:
3×3 Matrix{Float64}:
1.0 0.0 0.0
0.571429 1.0 0.0
0.142857 -0.24 1.0
U factor:
3×3 Matrix{Float64}:
7.0 8.0 1.0
0.0 -3.57143 5.42857
0.0 0.0 4.16
SVD{Float64, Float64, Matrix{Float64}, Vector{Float64}}
U factor:
3×3 Matrix{Float64}:
-0.254232 -0.28571 -0.923978
-0.458299 -0.805704 0.375238
-0.851662 0.518856 0.0738954
singular values:
3-element Vector{Float64}:
12.015096056147224
5.870562197511579
1.4744376035300788
Vt factor:
3×3 Matrix{Float64}:
-0.669912 -0.647524 -0.363223
0.0210319 0.472481 -0.88109
0.742142 -0.597892 -0.302902
Type | Description |
---|---|
Symmetric | Symmetric matrix |
Hermitian | Hermitian matrix |
UpperTriangular | Upper triangular matrix |
UnitUpperTriangular | Upper triangular matrix with unit diagonal |
LowerTriangular | Lower triangular matrix |
UnitLowerTriangular | Lower triangular matrix with unit diagonal |
UpperHessenberg | Upper Hessenberg matrix |
Tridiagonal | Tridiagonal matrix |
SymTridiagonal | Symmetric tridiagonal matrix |
Bidiagonal | Upper/lower bidiagonal matrix |
Diagonal | Diagonal matrix |
UniformScaling | Uniform scaling operator |
3×3 UnitUpperTriangular{Int64, Matrix{Int64}}:
1 2 3
⋅ 1 3
⋅ ⋅ 1
Random.jl es parte de Standard Library
rand() = 0.5447897275325418
rand((-1, 2)) = 2
rand(5:10) = 6
Statistics.jl es parte de Standard Library.
Es reseñable la familia JuliaStats: DataFrames, Distributions, HypothesisTests, TimeSeries, …
The Distributions package provides a large collection of probabilistic distributions and related functions. Particularly, Distributions implements:
mean(d) = 0.0
rand(d, 3) =
[-1.1390714777702335, -0.4763905560075741, 2.1951153992912715]
3-element Vector{Float64}:
-1.1390714777702335
-0.4763905560075741
2.1951153992912715
Ver también MeasureTheory.jl
Turing is a general-purpose probabilistic programming language for robust, efficient Bayesian inference and decision making. Current features include:
* General-purpose probabilistic programming with an intuitive modelling interface;
* Robust, efficient Hamiltonian Monte Carlo (HMC) sampling for differentiable posterior distributions;
* Particle MCMC sampling for complex posterior distributions involving discrete variables and stochastic control flow; and
* Compositional inference via Gibbs sampling that combines particle MCMC, HMC and random-walk MH (RWMH).
En este curso no haremos hincapié en las capacidades y técnicas de Julia para hacer cálculo en paralelo.
Para el cálculo paralelo en CPU se cuenta con Distributed
en la Standard Library. Véase este Tutorial.
Para cálculo paralelo en GPU hay un conjunto de paquetes llamados JuliaGPU: Cuda.jl, AMDGPU.jl, Metal.jl, OpenCL.jl, …
Es un paquete de gestión de investigación científica.
Permite organizar la versión de los paquetes, llevar orden de los casos simulados, y nombrar archivos de forma automática.