Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add spanish translation, Literate.jl backend #30

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a200be1
add literate jl files
miguelraz Apr 18, 2021
53433ec
traslation to spanish README
miguelraz Apr 18, 2021
88f18ed
translation to spanish 02
miguelraz Apr 18, 2021
cf1fcf7
translation to spanish 02_basicinfo.jl
miguelraz Apr 18, 2021
9b82f62
translation to spanish 03_missingvalues.jl
miguelraz Apr 18, 2021
51662a6
translation to spanish 04_loadsave.jl
miguelraz Apr 18, 2021
80375c0
translation to spanish 05_columns.jl
miguelraz Apr 18, 2021
9769314
spanish translation of 06_rows.jl
miguelraz Apr 18, 2021
3bb8157
spanish translation of 07_factors.jl
miguelraz Apr 18, 2021
b4a9c49
spanish translation of 08_joins.jl
miguelraz Apr 18, 2021
f461dd0
spanish translation of 09_reshaping.jl
miguelraz Apr 18, 2021
73a8f67
spanish translation of 10_transforms.jl
miguelraz Apr 18, 2021
49ea34a
update topics in README.md
miguelraz Apr 18, 2021
670e441
spanish translation of 11_performance.jl
miguelraz Apr 18, 2021
2f0ff63
spanish translation of 12_pitfalls.jl
miguelraz Apr 18, 2021
669663c
spanish translation of 13_extras.jl
miguelraz Apr 18, 2021
fb6a33c
Update literate_notebooks/src-ES/01_constructors.jl
miguelraz Apr 18, 2021
e2a8f25
Update literate_notebooks/src-ES/01_constructors.jl
miguelraz Apr 18, 2021
c862b3b
Update literate_notebooks/src-ES/01_constructors.jl
miguelraz Apr 18, 2021
8a31c93
Update literate_notebooks/src-ES/01_constructors.jl
miguelraz Apr 18, 2021
b88e172
spanish translation - add cheatsheets and language comparisons docs
miguelraz Apr 18, 2021
ed6c52c
Merge branch 'spanish-tutorials' of https://github.com/miguelraz/Juli…
miguelraz Apr 18, 2021
c0dd3c4
spanish translation - missed intro in 03_missingvalues.jl
miguelraz Apr 18, 2021
96a326b
spanish translation - add .toml files, fixup typos and word choices
miguelraz Apr 18, 2021
9edb30d
update stale 01_constructors.jl
miguelraz Apr 20, 2021
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
37 changes: 20 additions & 17 deletions literate_notebooks/src-ES/12_pitfalls.jl
Original file line number Diff line number Diff line change
@@ -1,73 +1,76 @@
# # Introduction to DataFrames
# # Introducción a DataFrames
# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018**
# (Traducción por Miguel Raz Guzmán Macedo, 18 de Abril de 2021)

using DataFrames

# ## Possible pitfalls
# ## Posibles errors comunes
miguelraz marked this conversation as resolved.
Show resolved Hide resolved

#-

# ### Know what is copied when creating a `DataFrame`
# ### Hay que saber qué se copia cuando se crea un `DataFrame`

x = DataFrame(rand(3, 5))

#-

y = DataFrame(x)
x === y # no copyinng performed
x === y # no se hace ninguna copia

#-

y = copy(x)
x === y # not the same object
x === y # no es el mismo objeto

#-

all(x[i] === y[i] for i in ncol(x)) # but the columns are the same
all(x[i] === y[i] for i in ncol(x)) # pero las columnas son las mismas

#-

x = 1:3; y = [1, 2, 3]; df = DataFrame(x=x,y=y) # the same when creating arrays or assigning columns, except ranges
x = 1:3; y = [1, 2, 3]; df = DataFrame(x=x,y=y) # lo mismo sucedo cuando creamos arreglos o asignamos columnas, excepto por rangos

#-

y === df[:y] # the same object
y === df[:y] # es el mismo objeto

#-

typeof(x), typeof(df[:x]) # range is converted to a vector
typeof(x), typeof(df[:x]) # un rango se convierte en un vector

# ### Do not modify the parent of `GroupedDataFrame`
# ### No hay que modificar el arreglo original de `GroupedDataFrame`

x = DataFrame(id=repeat([1,2], outer=3), x=1:6)
g = groupby(x, :id)

#-

x[1:3, 1]=[2,2,2]
g # well - it is wrong now, g is only a view
g # pues, está mal por ahora - `g` es sólo un `view`

# ### Remember that you can filter columns of a `DataFrame` using booleans
# ### Recuerda: peudes filtrar columnas de un `DataFrame` usando booleans
miguelraz marked this conversation as resolved.
Show resolved Hide resolved

srand(1)
x = DataFrame(rand(5, 5))

#-

x[x[:x1] .< 0.25] # well - we have filtered columns not rows by accident as you can select columns using booleans
x[x[:x1] .< 0.25] # oops, filtramos columnas y no filas, por accidente, pues puedes seleccionar columnas usando booleanos

#-

x[x[:x1] .< 0.25, :] # probably this is what we wanted
x[x[:x1] .< 0.25, :] # esto es probablemente es lo que queríamos

# ### Column selection for DataFrame creates aliases unless explicitly copied
# ### Seleccionar columnas de un DataFrame crea un alias si no se copia explícitamente

x = DataFrame(a=1:3)
x[:b] = x[1] # alias
x[:c] = x[:, 1] # also alias
x[:d] = x[1][:] # copy
x[:e] = copy(x[1]) # explicit copy
x[:c] = x[:, 1] # igual esalias
x[:d] = x[1][:] # copia
x[:e] = copy(x[1]) # copia explícita
display(x)
x[1,1] = 100
display(x)