Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions 1 - Strings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Strings\n",
"\n",
"Topics:\n",
"1. How to get a string\n",
"2. String interpolation\n",
"3. String concatenation"
"# Cadenas de texto (Strings)\n",
" \n",
"Temas:\n",
"1. Cómo obtener una cadena de texto\n",
"2. Interpolación de cadenas\n",
"3. Concatenación de cadenas"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## How to get a string\n",
"\n",
"Enclose your characters in \" \" or \"\"\" \"\"\"!"
"## Cómo obtener una cadena de texto\n",
" \n",
"¡Encierra tus caracteres entre \" \" o \"\"\" \"\"\"!"
]
},
{
Expand Down Expand Up @@ -65,8 +65,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"There are a couple functional differences between strings enclosed in single and triple quotes. <br>\n",
"One difference is that, in the latter case, you can use quotation marks within your string."
"Existen un par de diferencias funcionales entre las cadenas encerradas en comillas simples y triples. <br>\n",
"Una diferencia es que, en el segundo caso, puedes usar comillas dentro de tu cadena."
]
},
{
Expand Down Expand Up @@ -119,7 +119,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that ' ' define a character, but NOT a string!"
"¡Nota que ' ' define un carácter, pero NO una cadena de texto!"
]
},
{
Expand Down Expand Up @@ -172,10 +172,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## String interpolation\n",
"\n",
"We can use the $ sign to insert existing variables into a string and to evaluate expressions within a string. <br>\n",
"Below is an example that contains some highly sensitive personal information."
"## Interpolación de cadenas\n",
" \n",
"Podemos usar el signo $ para insertar variables existentes en una cadena y para evaluar expresiones dentro de una cadena. <br>\n",
"Abajo hay un ejemplo que contiene información personal altamente sensible."
]
},
{
Expand Down Expand Up @@ -240,11 +240,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## String concatenation\n",
"\n",
"Below are three ways we can concatenate strings! <br><br>\n",
"The first way is to use the `string()` function. <br>\n",
"`string()` converts non-string inputs to strings."
"## Concatenación de cadenas\n",
" \n",
"¡Abajo hay tres formas de concatenar cadenas! <br><br>\n",
"La primera forma es usar la función `string()`. <br>\n",
"`string()` convierte entradas que no son cadenas a cadenas."
]
},
{
Expand Down Expand Up @@ -313,7 +313,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We can also use `*` for concatenation!"
"¡También podemos usar `*` para concatenar!"
]
},
{
Expand All @@ -340,10 +340,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Exercises\n",
"\n",
"### Ejercicios\n",
" \n",
"#### 2.1 \n",
"Create a string that says \"hi\" 1000 times, first with `repeat` and then with the exponentiation operator, which can call `*` under the hood. Assign it the variable `hi` below."
"Crea una cadena que diga \"hi\" 1000 veces, primero con `repeat` y luego con el operador de potenciación, que puede llamar a `*` internamente. Asígnala a la variable `hi` abajo."
]
},
{
Expand Down Expand Up @@ -390,18 +390,18 @@
"metadata": {},
"source": [
"#### 2.2 \n",
"Declare two variables\n",
"\n",
"Declara dos variables\n",
" \n",
"```julia\n",
"a = 3\n",
"b = 4\n",
"```\n",
"and use them to create two strings:\n",
"y úsalas para crear dos cadenas:\n",
"```julia\n",
"\"3 + 4\"\n",
"\"7\" \n",
"```\n",
"and store the results in `c` and `d` respectively"
"y guarda los resultados en `c` y `d` respectivamente"
]
},
{
Expand Down
78 changes: 16 additions & 62 deletions 10 - Basic linear algebra.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Basic linear algebra in Julia\n",
"Author: Andreas Noack Jensen (MIT & JuliaComputing) (https://twitter.com/anoackjensen?lang=en)\n",
"(with edits from Jane Herriman)"
]
"source": "# Álgebra lineal básica en Julia\nAutor: Andreas Noack Jensen (MIT & JuliaComputing) (https://twitter.com/anoackjensen?lang=en)\n(con ediciones de Jane Herriman)"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First let's define a random matrix"
]
"source": "Primero definamos una matriz aleatoria"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -42,9 +36,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Define a vector of ones"
]
"source": "Definir un vector de unos"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -72,12 +64,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Notice that $A$ has type Array{Int64,2} but $x$ has type Array{Float64,1}. Julia defines the aliases Vector{Type}=Array{Type,1} and Matrix{Type}=Array{Type,2}. \n",
"\n",
"Many of the basic operations are the same as in other languages\n",
"#### Multiplication"
]
"source": "Observa que $A$ tiene tipo Array{Int64,2} pero $x$ tiene tipo Array{Float64,1}. Julia define los alias Vector{Type}=Array{Type,1} y Matrix{Type}=Array{Type,2}. \n\nMuchas de las operaciones básicas son las mismas que en otros lenguajes\n#### Multiplicación"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -105,10 +92,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Transposition\n",
"As in other languages `A'` is the conjugate transpose, or adjoint"
]
"source": "#### Transposición\nComo en otros lenguajes `A'` es la transpuesta conjugada, o adjunta"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -136,9 +120,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"and we can get the transpose with"
]
"source": "y podemos obtener la transpuesta con"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -166,10 +148,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Transposed multiplication\n",
"Julia allows us to write this without *"
]
"source": "#### Multiplicación transpuesta\nJulia nos permite escribir esto sin *"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -197,10 +176,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Solving linear systems \n",
"The problem $Ax=b$ for ***square*** $A$ is solved by the \\ function."
]
"source": "#### Resolución de sistemas lineales \nEl problema $Ax=b$ para $A$ ***cuadrada*** se resuelve con la función \\."
},
{
"cell_type": "code",
Expand Down Expand Up @@ -228,9 +204,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`A\\b` gives us the *least squares solution* if we have an overdetermined linear system (a \"tall\" matrix)"
]
"source": "`A\\b` nos da la *solución de mínimos cuadrados* si tenemos un sistema lineal sobredeterminado (una matriz \"alta\")"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -280,9 +254,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"and the *minimum norm least squares solution* if we have a rank-deficient least squares problem"
]
"source": "y la *solución de mínimos cuadrados de norma mínima* si tenemos un problema de mínimos cuadrados deficiente en rango"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -333,9 +305,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Julia also gives us the minimum norm solution when we have an underdetermined solution (a \"short\" matrix)"
]
"source": "Julia también nos da la solución de norma mínima cuando tenemos una solución subdeterminada (una matriz \"corta\")"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -386,22 +356,12 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# The LinearAlgebra library\n",
"\n",
"While much of linear algebra is available in Julia by default (as shown above), there's a standard library named `LinearAlgebra` that brings in many more relevant names and functions. In particular, it provides factorizations and some structured matrix types. As with all packages, you can bring these additional features into your session with a `using LinearAlgebra`."
]
"source": "# La librería LinearAlgebra\n\nAunque mucho del álgebra lineal está disponible en Julia por defecto (como se mostró arriba), hay una librería estándar llamada `LinearAlgebra` que incorpora muchos más nombres y funciones relevantes. En particular, proporciona factorizaciones y algunos tipos de matrices estructuradas. Como con todos los paquetes, puedes traer estas características adicionales a tu sesión con `using LinearAlgebra`."
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Exercises\n",
"\n",
"#### 10.1 \n",
"Take the inner product (or \"dot\" product) of a vector `v` with itself and assign it to variable `dot_v`.\n",
"\n"
]
"source": "### Ejercicios\n\n#### 10.1 \nToma el producto interior (o producto \"punto\") de un vector `v` consigo mismo y asígnalo a la variable `dot_v`."
},
{
"cell_type": "code",
Expand Down Expand Up @@ -458,10 +418,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 10.2 \n",
"Take the outer product of a vector v with itself and assign it to variable `outer_v`"
]
"source": "#### 10.2 \nToma el producto exterior de un vector v consigo mismo y asígnalo a la variable `outer_v`"
},
{
"cell_type": "code",
Expand All @@ -484,10 +441,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 10.3 \n",
"Use [LinearAlgebra.cross](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#LinearAlgebra.cross) to compute the cross product of a vector v with itself and assign it to variable `cross_v`"
]
"source": "#### 10.3 \nUsa [LinearAlgebra.cross](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#LinearAlgebra.cross) para calcular el producto cruz de un vector v consigo mismo y asígnalo a la variable `cross_v`"
},
{
"cell_type": "code",
Expand Down Expand Up @@ -535,4 +489,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
29 changes: 4 additions & 25 deletions 11 - Factorizations and other fun.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,12 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Factorizations and other fun\n",
"Based on work by Andreas Noack\n",
"\n",
"## Outline\n",
" - Factorizations\n",
" - Special matrix structures\n",
" - Generic linear algebra"
]
"source": "# Factorizaciones y otras diversiones\nBasado en el trabajo de Andreas Noack\n\n## Resumen\n - Factorizaciones\n - Estructuras de matrices especiales\n - Álgebra lineal genérica"
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Before we get started, let's set up a linear system and use `LinearAlgebra` to bring in the factorizations and special matrix structures."
]
"source": "Antes de comenzar, configuremos un sistema lineal y usemos `LinearAlgebra` para incorporar las factorizaciones y estructuras de matrices especiales."
},
{
"cell_type": "code",
Expand Down Expand Up @@ -49,18 +39,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Factorizations\n",
"\n",
"#### LU factorizations\n",
"In Julia we can perform an LU factorization\n",
"```julia\n",
"PA = LU\n",
"``` \n",
"where `P` is a permutation matrix, `L` is lower triangular unit diagonal and `U` is upper triangular, using `lufact`.\n",
"\n",
"Julia allows computing the LU factorization and defines a composite factorization type for storing it."
]
"source": "## Factorizaciones\n\n#### Factorizaciones LU\nEn Julia podemos realizar una factorización LU\n```julia\nPA = LU\n``` \ndonde `P` es una matriz de permutación, `L` es triangular inferior con diagonal unitaria y `U` es triangular superior, usando `lufact`.\n\nJulia permite calcular la factorización LU y define un tipo de factorización compuesta para almacenarla."
},
{
"cell_type": "code",
Expand Down Expand Up @@ -1014,4 +993,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
Loading