From a200be1ffad4369a33803edf4132e86e910ff7ba Mon Sep 17 00:00:00 2001 From: miguel raz Date: Sat, 17 Apr 2021 19:34:51 -0500 Subject: [PATCH 01/20] add literate jl files --- literate_notebooks/src-ES/01_constructors.jl | 143 +++++++++++ literate_notebooks/src-ES/02_basicinfo.jl | 76 ++++++ literate_notebooks/src-ES/03_missingvalues.jl | 112 +++++++++ literate_notebooks/src-ES/04_loadsave.jl | 64 +++++ literate_notebooks/src-ES/05_columns.jl | 187 ++++++++++++++ literate_notebooks/src-ES/06_rows.jl | 177 ++++++++++++++ literate_notebooks/src-ES/07_factors.jl | 231 ++++++++++++++++++ literate_notebooks/src-ES/08_joins.jl | 76 ++++++ literate_notebooks/src-ES/09_reshaping.jl | 90 +++++++ literate_notebooks/src-ES/10_transforms.jl | 80 ++++++ literate_notebooks/src-ES/11_performance.jl | 135 ++++++++++ literate_notebooks/src-ES/12_pitfalls.jl | 73 ++++++ literate_notebooks/src-ES/13_extras.jl | 198 +++++++++++++++ literate_notebooks/src/01_constructors.jl | 143 +++++++++++ literate_notebooks/src/02_basicinfo.jl | 76 ++++++ literate_notebooks/src/03_missingvalues.jl | 112 +++++++++ literate_notebooks/src/04_loadsave.jl | 64 +++++ literate_notebooks/src/05_columns.jl | 187 ++++++++++++++ literate_notebooks/src/06_rows.jl | 177 ++++++++++++++ literate_notebooks/src/07_factors.jl | 231 ++++++++++++++++++ literate_notebooks/src/08_joins.jl | 76 ++++++ literate_notebooks/src/09_reshaping.jl | 90 +++++++ literate_notebooks/src/10_transforms.jl | 80 ++++++ literate_notebooks/src/11_performance.jl | 135 ++++++++++ literate_notebooks/src/12_pitfalls.jl | 73 ++++++ literate_notebooks/src/13_extras.jl | 198 +++++++++++++++ 26 files changed, 3284 insertions(+) create mode 100644 literate_notebooks/src-ES/01_constructors.jl create mode 100644 literate_notebooks/src-ES/02_basicinfo.jl create mode 100644 literate_notebooks/src-ES/03_missingvalues.jl create mode 100644 literate_notebooks/src-ES/04_loadsave.jl create mode 100644 literate_notebooks/src-ES/05_columns.jl create mode 100644 literate_notebooks/src-ES/06_rows.jl create mode 100644 literate_notebooks/src-ES/07_factors.jl create mode 100644 literate_notebooks/src-ES/08_joins.jl create mode 100644 literate_notebooks/src-ES/09_reshaping.jl create mode 100644 literate_notebooks/src-ES/10_transforms.jl create mode 100644 literate_notebooks/src-ES/11_performance.jl create mode 100644 literate_notebooks/src-ES/12_pitfalls.jl create mode 100644 literate_notebooks/src-ES/13_extras.jl create mode 100644 literate_notebooks/src/01_constructors.jl create mode 100644 literate_notebooks/src/02_basicinfo.jl create mode 100644 literate_notebooks/src/03_missingvalues.jl create mode 100644 literate_notebooks/src/04_loadsave.jl create mode 100644 literate_notebooks/src/05_columns.jl create mode 100644 literate_notebooks/src/06_rows.jl create mode 100644 literate_notebooks/src/07_factors.jl create mode 100644 literate_notebooks/src/08_joins.jl create mode 100644 literate_notebooks/src/09_reshaping.jl create mode 100644 literate_notebooks/src/10_transforms.jl create mode 100644 literate_notebooks/src/11_performance.jl create mode 100644 literate_notebooks/src/12_pitfalls.jl create mode 100644 literate_notebooks/src/13_extras.jl diff --git a/literate_notebooks/src-ES/01_constructors.jl b/literate_notebooks/src-ES/01_constructors.jl new file mode 100644 index 0000000..333a81e --- /dev/null +++ b/literate_notebooks/src-ES/01_constructors.jl @@ -0,0 +1,143 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** +# +# Let's get started by loading the `DataFrames` package. + +using DataFrames + +# ## Constructors and conversion + +#- + +# ### Constructors +# +# In this section, you'll see many ways to create a `DataFrame` using the `DataFrame()` constructor. +# +# First, we could create an empty DataFrame, + +DataFrame() # empty DataFrame + +# Or we could call the constructor using keyword arguments to add columns to the `DataFrame`. + +DataFrame(A=1:3, B=rand(3), C=randstring.([3,3,3])) + +# We can create a `DataFrame` from a dictionary, in which case keys from the dictionary will be sorted to create the `DataFrame` columns. + +x = Dict("A" => [1,2], "B" => [true, false], "C" => ['a', 'b']) +DataFrame(x) + +# Rather than explicitly creating a dictionary first, as above, we could pass `DataFrame` arguments with the syntax of dictionary key-value pairs. +# +# Note that in this case, we use symbols to denote the column names and arguments are not sorted. For example, `:A`, the symbol, produces `A`, the name of the first column here: + +DataFrame(:A => [1,2], :B => [true, false], :C => ['a', 'b']) + +# Here we create a `DataFrame` from a vector of vectors, and each vector becomes a column. + +DataFrame([rand(3) for i in 1:3]) + +# For now we can construct a single `DataFrame` from a `Vector` of atoms, creating a `DataFrame` with a single row. In future releases of DataFrames.jl, this will throw an error. + +DataFrame(rand(3)) + +# Instead use a transposed vector if you have a vector of atoms (in this way you effectively pass a two dimensional array to the constructor which is supported). + +DataFrame(transpose([1, 2, 3])) + +# Pass a second argument to give the columns names. + +DataFrame([1:3, 4:6, 7:9], [:A, :B, :C]) + +# Here we create a `DataFrame` from a matrix, + +DataFrame(rand(3,4)) + +# and here we do the same but also pass column names. + +DataFrame(rand(3,4), Symbol.('a':'d')) + +# We can also construct an uninitialized DataFrame. +# +# Here we pass column types, names and number of rows; we get `missing` in column :C because `Any >: Missing`. + +DataFrame([Int, Float64, Any], [:A, :B, :C], 1) + +# Here we create a `DataFrame`, but column `:C` is #undef and Jupyter has problem with displaying it. (This works OK at the REPL.) +# +# This will be fixed in next release of DataFrames! + +DataFrame([Int, Float64, String], [:A, :B, :C], 1) + +# To initialize a `DataFrame` with column names, but no rows use + +DataFrame([Int, Float64, String], [:A, :B, :C], 0) + +# This syntax gives us a quick way to create homogenous `DataFrame`. + +DataFrame(Int, 3, 5) + +# This example is similar, but has nonhomogenous columns. + +DataFrame([Int, Float64], 4) + +# Finally, we can create a `DataFrame` by copying an existing `DataFrame`. +# +# Note that `copy` creates a shallow copy. + +y = DataFrame(x) +z = copy(x) +(x === y), (x === z), isequal(x, z) + +# ### Conversion to a matrix +# +# Let's start by creating a `DataFrame` with two rows and two columns. + +x = DataFrame(x=1:2, y=["A", "B"]) + +# We can create a matrix by passing this `DataFrame` to `Matrix`. + +Matrix(x) + +# This would work even if the `DataFrame` had some `missing`s: + +x = DataFrame(x=1:2, y=[missing,"B"]) + +#- + +Matrix(x) + +# In the two previous matrix examples, Julia created matrices with elements of type `Any`. We can see more clearly that the type of matrix is inferred when we pass, for example, a `DataFrame` of integers to `Matrix`, creating a 2D `Array` of `Int64`s: + +x = DataFrame(x=1:2, y=3:4) + +#- + +Matrix(x) + +# In this next example, Julia correctly identifies that `Union` is needed to express the type of the resulting `Matrix` (which contains `missing`s). + +x = DataFrame(x=1:2, y=[missing,4]) + +#- + +Matrix(x) + +# Note that we can't force a conversion of `missing` values to `Int`s! + +Matrix{Int}(x) + +# ### Handling of duplicate column names +# +# We can pass the `makeunique` keyword argument to allow passing duplicate names (they get deduplicated) + +df = DataFrame(:a=>1, :a=>2, :a_1=>3; makeunique=true) + +# Otherwise, duplicates will not be allowed in the future. + +df = DataFrame(:a=>1, :a=>2, :a_1=>3) + +# A constructor that is passed column names as keyword arguments is a corner case. +# You cannot pass `makeunique` to allow duplicates here. + +df = DataFrame(a=1, a=2, makeunique=true) + diff --git a/literate_notebooks/src-ES/02_basicinfo.jl b/literate_notebooks/src-ES/02_basicinfo.jl new file mode 100644 index 0000000..6cde7c6 --- /dev/null +++ b/literate_notebooks/src-ES/02_basicinfo.jl @@ -0,0 +1,76 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** + +using DataFrames # load package + +# ## Getting basic information about a data frame +# +# Let's start by creating a `DataFrame` object, `x`, so that we can learn how to get information on that data frame. + +x = DataFrame(A = [1, 2], B = [1.0, missing], C = ["a", "b"]) + +# The standard `size` function works to get dimensions of the `DataFrame`, + +size(x), size(x, 1), size(x, 2) + +# as well as `nrow` and `ncol` from R; `length` gives number of columns. + +nrow(x), ncol(x), length(x) + +# `describe` gives basic summary statistics of data in your `DataFrame`. + +describe(x) + +# Use `showcols` to get informaton about columns stored in a DataFrame. + +showcols(x) + +# `names` will return the names of all columns, + +names(x) + +# and `eltypes` returns their types. + +eltypes(x) + +# Here we create some large DataFrame + +y = DataFrame(rand(1:10, 1000, 10)); + +# and then we can use `head` to peek into its top rows + +head(y) + +# and `tail` to see its bottom rows. + +tail(y, 3) + +# ### Most elementary get and set operations +# +# Given the `DataFrame`, `x`, here are three ways to grab one of its columns as a `Vector`: + +x[1], x[:A], x[:, 1] + +# To grab one row as a DataFrame, we can index as follows. + +x[1, :] + +# We can grab a single cell or element with the same syntax to grab an element of an array. + +x[1, 1] + +# Assignment can be done in ranges to a scalar, + +x[1:2, 1:2] = 1 +x + +# to a vector of length equal to the number of assigned rows, + +x[1:2, 1:2] = [1,2] +x + +# or to another data frame of matching size. + +x[1:2, 1:2] = DataFrame([5 6; 7 8]) +x + diff --git a/literate_notebooks/src-ES/03_missingvalues.jl b/literate_notebooks/src-ES/03_missingvalues.jl new file mode 100644 index 0000000..1e17d97 --- /dev/null +++ b/literate_notebooks/src-ES/03_missingvalues.jl @@ -0,0 +1,112 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** + +using DataFrames # load package + +# ## Handling missing values +# +# A singelton type `Missings.Missing` allows us to deal with missing values. + +missing, typeof(missing) + +# Arrays automatically create an appropriate union type. + +x = [1, 2, missing, 3] + +# `ismissing` checks if passed value is missing. + +ismissing(1), ismissing(missing), ismissing(x), ismissing.(x) + +# We can extract the type combined with Missing from a `Union` via +# +# (This is useful for arrays!) + +eltype(x), Missings.T(eltype(x)) + +# `missing` comparisons produce `missing`. + +missing == missing, missing != missing, missing < missing + +# This is also true when `missing`s are compared with values of other types. + +1 == missing, 1 != missing, 1 < missing + +# `isequal`, `isless`, and `===` produce results of type `Bool`. + +isequal(missing, missing), missing === missing, isequal(1, missing), isless(1, missing) + +# In the next few examples, we see that many (not all) functions handle `missing`. + +map(x -> x(missing), [sin, cos, zero, sqrt]) # part 1 + +#- + +map(x -> x(missing, 1), [+, - , *, /, div]) # part 2 + +#- + +map(x -> x([1,2,missing]), [minimum, maximum, extrema, mean, any, float]) # part 3 + +# `skipmissing` returns iterator skipping missing values. We can use `collect` and `skipmissing` to create an array that excludes these missing values. + +collect(skipmissing([1, missing, 2, missing])) + +# Similarly, here we combine `collect` and `Missings.replace` to create an array that replaces all missing values with some value (`NaN` in this case). + +collect(Missings.replace([1.0, missing, 2.0, missing], NaN)) + +# Another way to do this: + +coalesce.([1.0, missing, 2.0, missing], NaN) + +# Caution: `nothing` would also be replaced here (for Julia 0.7 a more sophisticated behavior of `coalesce` that allows to avoid this problem is planned). + +coalesce.([1.0, missing, nothing, missing], NaN) + +# You can use `recode` if you have homogenous output types. + +recode([1.0, missing, 2.0, missing], missing=>NaN) + +# You can use `unique` or `levels` to get unique values with or without missings, respectively. + +unique([1, missing, 2, missing]), levels([1, missing, 2, missing]) + +# In this next example, we convert `x` to `y` with `allowmissing`, where `y` has a type that accepts missings. + +x = [1,2,3] +y = allowmissing(x) + +# Then, we convert back with `disallowmissing`. This would fail if `y` contained missing values! + +z = disallowmissing(y) +x,y,z + +# In this next example, we show that the type of each column in `x` is initially `Int64`. After using `allowmissing!` to accept missing values in columns 1 and 3, the types of those columns become `Union`s of `Int64` and `Missings.Missing`. + +x = DataFrame(Int, 2, 3) +println("Before: ", eltypes(x)) +allowmissing!(x, 1) # make first column accept missings +allowmissing!(x, :x3) # make :x3 column accept missings +println("After: ", eltypes(x)) + +# In this next example, we'll use `completecases` to find all the rows of a `DataFrame` that have complete data. + +x = DataFrame(A=[1, missing, 3, 4], B=["A", "B", missing, "C"]) +println(x) +println("Complete cases:\n", completecases(x)) + +# We can use `dropmissing` or `dropmissing!` to remove the rows with incomplete data from a `DataFrame` and either create a new `DataFrame` or mutate the original in-place. + +y = dropmissing(x) +dropmissing!(x) +[x, y] + +# When we call `showcols` on a `DataFrame` with dropped missing values, the columns still allow missing values. + +showcols(x) + +# Since we've excluded missing values, we can safely use `disallowmissing!` so that the columns will no longer accept missing values. + +disallowmissing!(x) +showcols(x) + diff --git a/literate_notebooks/src-ES/04_loadsave.jl b/literate_notebooks/src-ES/04_loadsave.jl new file mode 100644 index 0000000..d166830 --- /dev/null +++ b/literate_notebooks/src-ES/04_loadsave.jl @@ -0,0 +1,64 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** + +using DataFrames # load package + +# ## Load and save DataFrames +# We do not cover all features of the packages. Please refer to their documentation to learn them. +# +# Here we'll load `CSV` to read and write CSV files and `JLD`, which allows us to work with a Julia native binary format. + +using CSV +using JLD + +# Let's create a simple `DataFrame` for testing purposes, + +x = DataFrame(A=[true, false, true], B=[1, 2, missing], + C=[missing, "b", "c"], D=['a', missing, 'c']) + + +# and use `eltypes` to look at the columnwise types. + +eltypes(x) + +# Let's use `CSV` to save `x` to disk; make sure `x.csv` does not conflict with some file in your working directory. + +CSV.write("x.csv", x) + +# Now we can see how it was saved by reading `x.csv`. + +print(read("x.csv", String)) + +# We can also load it back. `use_mmap=false` disables memory mapping so that on Windows the file can be deleted in the same session. + +y = CSV.read("x.csv", use_mmap=false) + +# When loading in a `DataFrame` from a `CSV`, all columns allow `Missing` by default. Note that the column types have changed! + +eltypes(y) + +# Now let's save `x` to a file in a binary format; make sure that `x.jld` does not exist in your working directory. + +save("x.jld", "x", x) + +# After loading in `x.jld` as `y`, `y` is identical to `x`. + +y = load("x.jld", "x") + +# Note that the column types of `y` are the same as those of `x`! + +eltypes(y) + +# Next, we'll create the files `bigdf.csv` and `bigdf.jld`, so be careful that you don't already have these files on disc! +# +# In particular, we'll time how long it takes us to write a `DataFrame` with 10^3 rows and 10^5 columns to `.csv` and `.jld` files. *You can expect JLD to be faster!* Use `compress=true` to reduce file sizes. + +bigdf = DataFrame(Bool, 10^3, 10^2) +@time CSV.write("bigdf.csv", bigdf) +@time save("bigdf.jld", "bigdf", bigdf) +getfield.(stat.(["bigdf.csv", "bigdf.jld"]), :size) + +# Finally, let's clean up. Do not run the next cell unless you are sure that it will not erase your important files. + +foreach(rm, ["x.csv", "x.jld", "bigdf.csv", "bigdf.jld"]) + diff --git a/literate_notebooks/src-ES/05_columns.jl b/literate_notebooks/src-ES/05_columns.jl new file mode 100644 index 0000000..f32e02a --- /dev/null +++ b/literate_notebooks/src-ES/05_columns.jl @@ -0,0 +1,187 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** + +using DataFrames # load package + +# ## Manipulating columns of DataFrame + +#- + +# ### Renaming columns +# +# Let's start with a `DataFrame` of `Bool`s that has default column names. + +x = DataFrame(Bool, 3, 4) + +# With `rename`, we create new `DataFrame`; here we rename the column `:x1` to `:A`. (`rename` also accepts collections of Pairs.) + +rename(x, :x1 => :A) + +# With `rename!` we do an in place transformation. +# +# This time we've applied a function to every column name. + +rename!(c -> Symbol(string(c)^2), x) + +# We can also change the name of a particular column without knowing the original. +# +# Here we change the name of the third column, creating a new `DataFrame`. + +rename(x, names(x)[3] => :third) + +# With `names!`, we can change the names of all variables. + +names!(x, [:a, :b, :c, :d]) + +# We get an error when we try to provide duplicate names + +names!(x, fill(:a, 4)) + +# unless we pass `makeunique=true`, which allows us to handle duplicates in passed names. + +names!(x, fill(:a, 4), makeunique=true) + +# ### Reordering columns + +#- + +# We can reorder the names(x) vector as needed, creating a new DataFrame. + +srand(1234) +x[shuffle(names(x))] + +# also `permutecols!` will be introduced in next release of DataFrames + +#- + +# ### Merging/adding columns + +x = DataFrame([(i,j) for i in 1:3, j in 1:4]) + +# With `hcat` we can merge two `DataFrame`s. Also [x y] syntax is supported but only when DataFrames have unique column names. + +hcat(x, x, makeunique=true) + +# We can also use `hcat` to add a new column; a default name `:x1` will be used for this column, so `makeunique=true` is needed. + +y = hcat(x, [1,2,3], makeunique=true) + +# You can also prepend a vector with `hcat`. + +hcat([1,2,3], x, makeunique=true) + +# Alternatively you could append a vector with the following syntax. This is a bit more verbose but cleaner. + +y = [x DataFrame(A=[1,2,3])] + +# Here we do the same but add column `:A` to the front. + +y = [DataFrame(A=[1,2,3]) x] + +# A column can also be added in the middle. Here a brute-force method is used and a new DataFrame is created. + +using BenchmarkTools +@btime [$x[1:2] DataFrame(A=[1,2,3]) $x[3:4]] + +# We could also do this with a specialized in place method `insert!`. Let's add `:newcol` to the `DataFrame` `y`. + +insert!(y, 2, [1,2,3], :newcol) + +# If you want to insert the same column name several times `makeunique=true` is needed as usual. + +insert!(y, 2, [1,2,3], :newcol, makeunique=true) + +# We can see how much faster it is to insert a column with `insert!` than with `hcat` using `@btime`. + +@btime insert!(copy($x), 3, [1,2,3], :A) + +# Let's use `insert!` to append a column in place, + +insert!(x, ncol(x)+1, [1,2,3], :A) + +# and to in place prepend a column. + +insert!(x, 1, [1,2,3], :B) + +# With `merge!`, let's merge the second DataFrame into first, but overwriting duplicates. + +df1 = DataFrame(x=1:3, y=4:6) +df2 = DataFrame(x='a':'c', z = 'd':'f', new=11:13) +df1, df2, merge!(df1, df2) + +# For comparison: merge two `DataFrames`s but renaming duplicate names via `hcat`. + +df1 = DataFrame(x=1:3, y=4:6) +df2 = DataFrame(x='a':'c', z = 'd':'f', new=11:13) +hcat(df1, df2, makeunique=true) + +# ### Subsetting/removing columns +# +# Let's create a new `DataFrame` `x` and show a few ways to create DataFrames with a subset of `x`'s columns. + +x = DataFrame([(i,j) for i in 1:3, j in 1:5]) + +# First we could do this by index + +x[[1,2,4,5]] + +# or by column name. + +x[[:x1, :x4]] + +# We can also choose to keep or exclude columns by `Bool`. (We need a vector whose length is the number of columns in the original `DataFrame`.) + +x[[true, false, true, false, true]] + +# Here we create a single column `DataFrame`, + +x[[:x1]] + +# and here we access the vector contained in column `:x1`. + +x[:x1] + +# We could grab the same vector by column number + +x[1] + +# and remove everything from a `DataFrame` with `empty!`. + +empty!(y) + +# Here we create a copy of `x` and delete the 3rd column from the copy with `delete!`. + +z = copy(x) +x, delete!(z, 3) + +# ### Modify column by name + +x = DataFrame([(i,j) for i in 1:3, j in 1:5]) + +# With the following syntax, the existing column is modified without performing any copying. + +x[:x1] = x[:x2] +x + +# We can also use the following syntax to add a new column at the end of a `DataFrame`. + +x[:A] = [1,2,3] +x + +# A new column name will be added to our `DataFrame` with the following syntax as well (7 is equal to `ncol(x)+1`). + +x[7] = 11:13 +x + +# ### Find column name + +x = DataFrame([(i,j) for i in 1:3, j in 1:5]) + +# We can check if a column with a given name exists via + +:x1 in names(x) + +# and determine its index via + +findfirst(names(x), :x2) + diff --git a/literate_notebooks/src-ES/06_rows.jl b/literate_notebooks/src-ES/06_rows.jl new file mode 100644 index 0000000..3660e40 --- /dev/null +++ b/literate_notebooks/src-ES/06_rows.jl @@ -0,0 +1,177 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames # load package +srand(1); + +# ## Manipulating rows of DataFrame + +#- + +# ### Reordering rows + +x = DataFrame(id=1:10, x = rand(10), y = [zeros(5); ones(5)]) # and we hope that x[:x] is not sorted :) + +#- + +issorted(x), issorted(x, :x) # check if a DataFrame or a subset of its columns is sorted + +#- + +sort!(x, :x) # sort x in place + +#- + +y = sort(x, :id) # new DataFrame + +#- + +sort(x, (:y, :x), rev=(true, false)) # sort by two columns, first is decreasing, second is increasing + +#- + +sort(x, (order(:y, rev=true), :x)) # the same as above + +#- + +sort(x, (order(:y, rev=true), order(:x, by=v->-v))) # some more fancy sorting stuff + +#- + +x[shuffle(1:10), :] # reorder rows (here randomly) + +#- + +sort!(x, :id) +x[[1,10],:] = x[[10,1],:] # swap rows +x + +#- + +x[1,:], x[10,:] = x[10,:], x[1,:] # and swap again +x + +# ### Merging/adding rows + +x = DataFrame(rand(3, 5)) + +#- + +[x; x] # merge by rows - data frames must have the same column names; the same is vcat + +#- + +y = x[reverse(names(x))] # get y with other order of names + +#- + +vcat(x, y) # we get what we want as vcat does column name matching + +#- + +vcat(x, y[1:3]) # but column names must still match + +#- + +append!(x, x) # the same but modifies x + +#- + +append!(x, y) # here column names must match exactly + +#- + +push!(x, 1:5) # add one row to x at the end; must give correct number of values and correct types +x + +#- + +push!(x, Dict(:x1=> 11, :x2=> 12, :x3=> 13, :x4=> 14, :x5=> 15)) # also works with dictionaries +x + +# ### Subsetting/removing rows + +x = DataFrame(id=1:10, val='a':'j') + +#- + +x[1:2, :] # by index + +#- + +view(x, 1:2) # the same but a view + +#- + +x[repmat([true, false], 5), :] # by Bool, exact length required + +#- + +view(x, repmat([true, false], 5), :) # view again + +#- + +deleterows!(x, 7) # delete one row + +#- + +deleterows!(x, 6:7) # delete a collection of rows + +#- + +x = DataFrame([1:4, 2:5, 3:6]) + +#- + +filter(r -> r[:x1] > 2.5, x) # create a new DataFrame where filtering function operates on DataFrameRow + +#- + +## in place modification of x, an example with do-block syntax +filter!(x) do r + if r[:x1] > 2.5 + return r[:x2] < 4.5 + end + r[:x3] < 3.5 +end + +# ### Deduplicating + +x = DataFrame(A=[1,2], B=["x","y"]) +append!(x, x) +x[:C] = 1:4 +x + +#- + +unique(x, [1,2]) # get first unique rows for given index + +#- + +unique(x) # now we look at whole rows + +#- + +nonunique(x, :A) # get indicators of non-unique rows + +#- + +unique!(x, :B) # modify x in place + +# ### Extracting one row from `DataFrame` into a vector + +x = DataFrame(x=[1,missing,2], y=["a", "b", missing], z=[true,false,true]) + +#- + +cols = [:x, :y] +[x[1, col] for col in cols] # subset of columns + +#- + +[[x[i, col] for col in names(x)] for i in 1:nrow(x)] # vector of vectors, each entry contains one full row of x + +#- + +Tuple(x[1, col] for col in cols) # similar construct for Tuples, when ported to Julia 0.7 NamedTuples will be added + diff --git a/literate_notebooks/src-ES/07_factors.jl b/literate_notebooks/src-ES/07_factors.jl new file mode 100644 index 0000000..a3ff03c --- /dev/null +++ b/literate_notebooks/src-ES/07_factors.jl @@ -0,0 +1,231 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames # load package + +# ## Working with CategoricalArrays + +#- + +# ### Constructor + +x = categorical(["A", "B", "B", "C"]) # unordered + +#- + +y = categorical(["A", "B", "B", "C"], ordered=true) # ordered, by default order is sorting order + +#- + +z = categorical(["A","B","B","C", missing]) # unordered with missings + +#- + +c = cut(1:10, 5) # ordered, into equal counts, possible to rename labels and give custom breaks + +#- + +by(DataFrame(x=cut(randn(100000), 10)), :x, d -> DataFrame(n=nrow(d)), sort=true) # just to make sure it works right + +#- + +v = categorical([1,2,2,3,3]) # contains integers not strings + +#- + +Vector{Union{String, Missing}}(z) # sometimes you need to convert back to a standard vector + +# ### Managing levels + +arr = [x,y,z,c,v] + +#- + +isordered.(arr) # chcek if categorical array is orderd + +#- + +ordered!(x, true), isordered(x) # make x ordered + +#- + +ordered!(x, false), isordered(x) # and unordered again + +#- + +levels.(arr) # list levels + +#- + +unique.(arr) # missing will be included + +#- + +y[1] < y[2] # can compare as y is ordered + +#- + +v[1] < v[2] # not comparable, v is unordered although it contains integers + +#- + +levels!(y, ["C", "B", "A"]) # you can reorder levels, mostly useful for ordered CategoricalArrays + +#- + +y[1] < y[2] # observe that the order is changed + +#- + +levels!(z, ["A", "B"]) # you have to specify all levels that are present + +#- + +levels!(z, ["A", "B"], allow_missing=true) # unless the underlying array allows for missings and force removal of levels + +#- + +z[1] = "B" +z # now z has only "B" entries + +#- + +levels(z) # but it remembers the levels it had (the reason is mostly performance) + +#- + +droplevels!(z) # this way we can clean it up +levels(z) + +# ### Data manipulation + +x, levels(x) + +#- + +x[2] = "0" +x, levels(x) # new level added at the end (works only for unordered) + +#- + +v, levels(v) + +#- + +v[1] + v[2] # even though underlying data is Int, we cannot operate on it + +#- + +Vector{Int}(v) # you have either to retrieve the data by conversion (may be expensive) + +#- + +get(v[1]) + get(v[2]) # or get a single value + +#- + +get.(v) # this will work for arrays witout missings + +#- + +get.(z) # but will fail on missing values + +#- + +Vector{Union{String, Missing}}(z) # you have to do the conversion + +#- + +z[1]*z[2], z.^2 # the only exception are CategoricalArrays based on String - you can operate on them normally + +#- + +recode([1,2,3,4,5,missing], 1=>10) # recode some values in an array; has also in place recode! equivalent + +#- + +recode([1,2,3,4,5,missing], "a", 1=>10, 2=>20) # here we provided a default value for not mapped recodings + +#- + +recode([1,2,3,4,5,missing], 1=>10, missing=>"missing") # to recode Missing you have to do it explicitly + +#- + +t = categorical([1:5; missing]) +t, levels(t) + +#- + +recode!(t, [1,3]=>2) +t, levels(t) # note that the levels are dropped after recode + +#- + +t = categorical([1,2,3], ordered=true) +levels(recode(t, 2=>0, 1=>-1)) # and if you introduce a new levels they are added at the end in the order of appearance + +#- + +t = categorical([1,2,3,4,5], ordered=true) # when using default it becomes the last level +levels(recode(t, 300, [1,2]=>100, 3=>200)) + +# ### Comparisons + +x = categorical([1,2,3]) +xs = [x, categorical(x), categorical(x, ordered=true), categorical(x, ordered=true)] +levels!(xs[2], [3,2,1]) +levels!(xs[4], [2,3,1]) +[a == b for a in xs, b in xs] # all are equal - comparison only by contents + +#- + +signature(x::CategoricalArray) = (x, levels(x), isordered(x)) # this is actually the full signature of CategoricalArray +## all are different, notice that x[1] and x[2] are unordered but have a different order of levels +[signature(a) == signature(b) for a in xs, b in xs] + +#- + +x[1] < x[2] # you cannot compare elements of unordered CategoricalArray + +#- + +t[1] < t[2] # but you can do it for an ordered one + +#- + +isless(x[1], x[2]) # isless works within the same CategoricalArray even if it is not ordered + +#- + +y = deepcopy(x) # but not across categorical arrays +isless(x[1], y[2]) + +#- + +isless(get(x[1]), get(y[2])) # you can use get to make a comparison of the contents of CategoricalArray + +#- + +x[1] == y[2] # equality tests works OK across CategoricalArrays + +# ### Categorical columns in a DataFrame + +df = DataFrame(x = 1:3, y = 'a':'c', z = ["a","b","c"]) + +#- + +categorical!(df) # converts all eltype(AbstractString) columns to categorical + +#- + +showcols(df) + +#- + +categorical!(df, :x) # manually convert to categorical column :x + +#- + +showcols(df) + diff --git a/literate_notebooks/src-ES/08_joins.jl b/literate_notebooks/src-ES/08_joins.jl new file mode 100644 index 0000000..e52bc22 --- /dev/null +++ b/literate_notebooks/src-ES/08_joins.jl @@ -0,0 +1,76 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2017** + +using DataFrames # load package + +# ## Joining DataFrames + +#- + +# ### Preparing DataFrames for a join + +x = DataFrame(ID=[1,2,3,4,missing], name = ["Alice", "Bob", "Conor", "Dave","Zed"]) +y = DataFrame(id=[1,2,5,6,missing], age = [21,22,23,24,99]) +x,y + +#- + +rename!(x, :ID=>:id) # names of columns on which we want to join must be the same + +# ### Standard joins: inner, left, right, outer, semi, anti + +join(x, y, on=:id) # :inner join by default, missing is joined + +#- + +join(x, y, on=:id, kind=:left) + +#- + +join(x, y, on=:id, kind=:right) + +#- + +join(x, y, on=:id, kind=:outer) + +#- + +join(x, y, on=:id, kind=:semi) + +#- + +join(x, y, on=:id, kind=:anti) + +# ### Cross join + +## cross-join does not require on argument +## it produces a Cartesian product or arguments +function expand_grid(;xs...) # a simple replacement for expand.grid in R + reduce((x,y) -> join(x, DataFrame(Pair(y...)), kind=:cross), + DataFrame(Pair(xs[1]...)), xs[2:end]) +end + +expand_grid(a=[1,2], b=["a","b","c"], c=[true,false]) + +# ### Complex cases of joins + +x = DataFrame(id1=[1,1,2,2,missing,missing], + id2=[1,11,2,21,missing,99], + name = ["Alice", "Bob", "Conor", "Dave","Zed", "Zoe"]) +y = DataFrame(id1=[1,1,3,3,missing,missing], + id2=[11,1,31,3,missing,999], + age = [21,22,23,24,99, 100]) +x,y + +#- + +join(x, y, on=[:id1, :id2]) # joining on two columns + +#- + +join(x, y, on=[:id1], makeunique=true) # with duplicates all combinations are produced (here :inner join) + +#- + +join(x, y, on=[:id1], kind=:semi) # but not by :semi join (as it would duplicate rows) + diff --git a/literate_notebooks/src-ES/09_reshaping.jl b/literate_notebooks/src-ES/09_reshaping.jl new file mode 100644 index 0000000..d6ec25b --- /dev/null +++ b/literate_notebooks/src-ES/09_reshaping.jl @@ -0,0 +1,90 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames # load package + +# ## Reshaping DataFrames + +#- + +# ### Wide to long + +x = DataFrame(id=[1,2,3,4], id2=[1,1,2,2], M1=[11,12,13,14], M2=[111,112,113,114]) + +#- + +melt(x, :id, [:M1, :M2]) # first pass id-variables and then measure variables; meltdf makes a view + +#- + +## optionally you can rename columns; melt and stack are identical but order of arguments is reversed +stack(x, [:M1, :M2], :id, variable_name=:key, value_name=:observed) # first measures and then id-s; stackdf creates view + +#- + +## if second argument is omitted in melt or stack , all other columns are assumed to be the second argument +## but measure variables are selected only if they are <: AbstractFloat +melt(x, [:id, :id2]) + +#- + +melt(x, [1, 2]) # you can use index instead of symbol + +#- + +bigx = DataFrame(rand(10^6, 10)) # a test comparing creation of new DataFrame and a view +bigx[:id] = 1:10^6 +@time melt(bigx, :id) +@time melt(bigx, :id) +@time meltdf(bigx, :id) +@time meltdf(bigx, :id); + +#- + +x = DataFrame(id = [1,1,1], id2=['a','b','c'], a1 = rand(3), a2 = rand(3)) + +#- + +melt(x) + +#- + +melt(DataFrame(rand(3,2))) # by default stack and melt treats floats as value columns + +#- + +df = DataFrame(rand(3,2)) +df[:key] = [1,1,1] +mdf = melt(df) # duplicates in key are silently accepted + +# ### Long to wide + +x = DataFrame(id = [1,1,1], id2=['a','b','c'], a1 = rand(3), a2 = rand(3)) + +#- + +y = melt(x, [1,2]) +display(x) +display(y) + +#- + +unstack(y, :id2, :variable, :value) # stndard unstack with a unique key + +#- + +unstack(y, :variable, :value) # all other columns are treated as keys + +#- + +## by default :id, :variable and :value names are assumed; in this case it produces duplicate keys +unstack(y) + +#- + +df = stack(DataFrame(rand(3,2))) + +#- + +unstack(df, :variable, :value) # unable to unstack when no key column is present + diff --git a/literate_notebooks/src-ES/10_transforms.jl b/literate_notebooks/src-ES/10_transforms.jl new file mode 100644 index 0000000..3b5b4aa --- /dev/null +++ b/literate_notebooks/src-ES/10_transforms.jl @@ -0,0 +1,80 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames # load package + +# ## Split-apply-combine + +x = DataFrame(id=[1,2,3,4,1,2,3,4], id2=[1,2,1,2,1,2,1,2], v=rand(8)) + +#- + +gx1 = groupby(x, :id) + +#- + +gx2 = groupby(x, [:id, :id2]) + +#- + +vcat(gx2...) # back to the original DataFrame + +#- + +x = DataFrame(id = [missing, 5, 1, 3, missing], x = 1:5) + +#- + +showall(groupby(x, :id)) # by default groups include mising values and are not sorted + +#- + +showall(groupby(x, :id, sort=true, skipmissing=true)) # but we can change it :) + +#- + +x = DataFrame(id=rand('a':'d', 100), v=rand(100)); +by(x, :id, y->mean(y[:v])) # apply a function to each group of a data frame + +#- + +by(x, :id, y->mean(y[:v]), sort=true) # we can sort the output + +#- + +by(x, :id, y->DataFrame(res=mean(y[:v]))) # this way we can set a name for a column - DataFramesMeta @by is better + +#- + +x = DataFrame(id=rand('a':'d', 100), x1=rand(100), x2=rand(100)) +aggregate(x, :id, sum) # apply a function over all columns of a data frame in groups given by id + +#- + +aggregate(x, :id, sum, sort=true) # also can be sorted + +# *We omit the discussion of of map/combine as I do not find them very useful (better to use by)* + +x = DataFrame(rand(3, 5)) + +#- + +map(mean, eachcol(x)) # map a function over each column and return a data frame + +#- + +foreach(c -> println(c[1], ": ", mean(c[2])), eachcol(x)) # a raw iteration returns a tuple with column name and values + +#- + +colwise(mean, x) # colwise is similar, but produces a vector + +#- + +x[:id] = [1,1,2] +colwise(mean,groupby(x, :id)) # and works on GroupedDataFrame + +#- + +map(r -> r[:x1]/r[:x2], eachrow(x)) # now the returned value is DataFrameRow which works similarly to a one-row DataFrame + diff --git a/literate_notebooks/src-ES/11_performance.jl b/literate_notebooks/src-ES/11_performance.jl new file mode 100644 index 0000000..005e877 --- /dev/null +++ b/literate_notebooks/src-ES/11_performance.jl @@ -0,0 +1,135 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames +using BenchmarkTools + +# ## Performance tips + +#- + +# ### Access by column number is faster than by name + +x = DataFrame(rand(5, 1000)) +@btime x[500]; +@btime x[:x500]; + +# ### When working with data `DataFrame` use barrier functions or type annotation + +function f_bad() # this function will be slow + srand(1); x = DataFrame(rand(1000000,2)) + y, z = x[1], x[2] + p = 0.0 + for i in 1:nrow(x) + p += y[i]*z[i] + end + p +end + +@btime f_bad(); + +#- + +@code_warntype f_bad() # the reason is that Julia does not know the types of columns in `DataFrame` + +#- + +## solution 1 is to use barrier function (it should be possible to use it in almost any code) +function f_inner(y,z) + p = 0.0 + for i in 1:length(y) + p += y[i]*z[i] + end + p +end + +function f_barrier() # extract the work to an inner function + srand(1); x = DataFrame(rand(1000000,2)) + f_inner(x[1], x[2]) +end + +function f_inbuilt() # or use inbuilt function if possible + srand(1); x = DataFrame(rand(1000000,2)) + dot(x[1], x[2]) +end + +@btime f_barrier(); +@btime f_inbuilt(); + +#- + +## solution 2 is to provide the types of extracted columns +## it is simpler but there are cases in which you will not know these types +function f_typed() + srand(1); x = DataFrame(rand(1000000,2)) + y::Vector{Float64}, z::Vector{Float64} = x[1], x[2] + p = 0.0 + for i in 1:nrow(x) + p += y[i]*z[i] + end + p +end + +@btime f_typed(); + +# ### Consider using delayed `DataFrame` creation technique + +function f1() + x = DataFrame(Float64, 10^4, 100) # we work with DataFrame directly + for c in 1:ncol(x) + d = x[c] + for r in 1:nrow(x) + d[r] = rand() + end + end + x +end + +function f2() + x = Vector{Any}(100) + for c in 1:length(x) + d = Vector{Float64}(10^4) + for r in 1:length(d) + d[r] = rand() + end + x[c] = d + end + DataFrame(x) # we delay creation of DataFrame after we have our job done +end + +@btime f1(); +@btime f2(); + +# ### You can add rows to a `DataFrame` in place and it is fast + +x = DataFrame(rand(10^6, 5)) +y = DataFrame(transpose(1.0:5.0)) +z = [1.0:5.0;] + +@btime vcat($x, $y); # creates a new DataFrame - slow +@btime append!($x, $y); # in place - fast + +x = DataFrame(rand(10^6, 5)) # reset to the same starting point +@btime push!($x, $z); # add a single row in place - fastest + +# ### Allowing `missing` as well as `categorical` slows down computations + +using StatsBase + +function test(data) # uses countmap function to test performance + println(eltype(data)) + x = rand(data, 10^6) + y = categorical(x) + println(" raw:") + @btime countmap($x) + println(" categorical:") + @btime countmap($y) + nothing +end + +test(1:10) +test([randstring() for i in 1:10]) +test(allowmissing(1:10)) +test(allowmissing([randstring() for i in 1:10])) + + diff --git a/literate_notebooks/src-ES/12_pitfalls.jl b/literate_notebooks/src-ES/12_pitfalls.jl new file mode 100644 index 0000000..8eb5e79 --- /dev/null +++ b/literate_notebooks/src-ES/12_pitfalls.jl @@ -0,0 +1,73 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames + +# ## Possible pitfalls + +#- + +# ### Know what is copied when creating a `DataFrame` + +x = DataFrame(rand(3, 5)) + +#- + +y = DataFrame(x) +x === y # no copyinng performed + +#- + +y = copy(x) +x === y # not the same object + +#- + +all(x[i] === y[i] for i in ncol(x)) # but the columns are the same + +#- + +x = 1:3; y = [1, 2, 3]; df = DataFrame(x=x,y=y) # the same when creating arrays or assigning columns, except ranges + +#- + +y === df[:y] # the same object + +#- + +typeof(x), typeof(df[:x]) # range is converted to a vector + +# ### Do not modify the parent of `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 + +# ### Remember that you can filter columns of a `DataFrame` using booleans + +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, :] # probably this is what we wanted + +# ### Column selection for DataFrame creates aliases unless explicitly copied + +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 +display(x) +x[1,1] = 100 +display(x) + diff --git a/literate_notebooks/src-ES/13_extras.jl b/literate_notebooks/src-ES/13_extras.jl new file mode 100644 index 0000000..5140a31 --- /dev/null +++ b/literate_notebooks/src-ES/13_extras.jl @@ -0,0 +1,198 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 13, 2018** + +using DataFrames + +# ## Extras - selected functionalities of selected packages + +#- + +# ### FreqTables: creating cross tabulations + +using FreqTables +df = DataFrame(a=rand('a':'d', 1000), b=rand(["x", "y", "z"], 1000)) +ft = freqtable(df, :a, :b) # observe that dimensions are sorted if possible + +#- + +ft[1,1], ft['b', "z"] # you can index the result using numbers or names + +#- + +prop(ft, 1) # getting proportions - 1 means we want to calculate them in rows (first dimension) + +#- + +prop(ft, 2) # and columns are normalized to 1.0 now + +#- + +x = categorical(rand(1:3, 10)) +levels!(x, [3, 1, 2, 4]) # reordering levels and adding an extra level +freqtable(x) # order is preserved and not-used level is shown + +#- + +freqtable([1,1,2,3,missing]) # by default missings are listed + +#- + +freqtable([1,1,2,3,missing], skipmissing=true) # but we can skip them + +# ### DataFramesMeta - working on `DataFrame` + +using DataFramesMeta +df = DataFrame(x=1:8, y='a':'h', z=repeat([true,false], outer=4)) + +#- + +@with(df, :x+:z) # expressions with columns of DataFrame + +#- + +@with df begin # you can define code blocks + a = :x[:z] + b = :x[.!:z] + :y + [a; b] +end + +#- + +a # @with creates hard scope so variables do not leak out + +#- + +df2 = DataFrame(a = [:a, :b, :c]) +@with(df2, :a .== ^(:a)) # sometimes we want to work on raw Symbol, ^() escapes it + +#- + +df2 = DataFrame(x=1:3, y=4:6, z=7:9) +@with(df2, _I_(2:3)) # _I_(expression) is translated to df2[expression] + +#- + +@where(df, :x .< 4, :z .== true) # very useful macro for filtering + +#- + +@select(df, :x, y = 2*:x, z=:y) # create a new DataFrame based on the old one + +#- + +@transform(df, a=1, x = 2*:x, y=:x) # create a new DataFrame adding columns based on the old one + +#- + +@transform(df, a=1, b=:a) # old DataFrame is used and :a is not present there + +#- + +@orderby(df, :z, -:x) # sorting into a new data frame, less powerful than sort, but lightweight + +#- + +@linq df |> # chaining of operations on DataFrame + where(:x .< 5) |> + orderby(:z) |> + transform(x²=:x.^2) |> + select(:z, :x, :x²) + +#- + +f(df, col) = df[col] # you can define your own functions and put them in the chain +@linq df |> where(:x .<= 4) |> f(:x) + +# ### DataFramesMeta - working on grouped `DataFrame` + +df = DataFrame(a = 1:12, b = repeat('a':'d', outer=3)) +g = groupby(df, :b) + +#- + +@by(df, :b, first=first(:a), last=last(:a), mean=mean(:a)) # more convinient than by from DataFrames + +#- + +@based_on(g, first=first(:a), last=last(:a), mean=mean(:a)) # the same as by but on grouped DataFrame + +#- + +@where(g, mean(:a) > 6.5) # filter gropus on aggregate conditions + +#- + +@orderby(g, -sum(:a)) # order groups on aggregate conditions + +#- + +@transform(g, center = mean(:a), centered = :a - mean(:a)) # perform operations within a group and return ungroped DataFrame + +#- + +DataFrame(g) # a nice convinience function not defined in DataFrames + +#- + +@transform(g) # actually this is the same + +#- + +@linq df |> groupby(:b) |> where(mean(:a) > 6.5) |> DataFrame # you can do chaining on grouped DataFrames as well + +# ### DataFramesMeta - rowwise operations on `DataFrame` + +df = DataFrame(a = 1:12, b = repeat(1:4, outer=3)) + +#- + +## such conditions are often needed but are complex to write +@transform(df, x = ifelse.((:a .> 6) .& (:b .== 4), "yes", "no")) + +#- + +## one option is to use a function that works on a single observation and broadcast it +myfun(a, b) = a > 6 && b == 4 ? "yes" : "no" +@transform(df, x = myfun.(:a, :b)) + +#- + +## or you can use @byrow! macro that allows you to process DataFrame rowwise +@byrow! df begin + @newcol x::Vector{String} + :x = :a > 6 && :b == 4 ? "yes" : "no" +end + +# ### Visualizing data with StatPlots + +using StatPlots # you might need to setup Plots package and some plotting backend first + +#- + +## we present only a minimal functionality of the package + +#- + +srand(1) +df = DataFrame(x = sort(randn(1000)), y=randn(1000), z = [fill("b", 500); fill("a", 500)]) + +#- + +@df df plot(:x, :y, legend=:topleft, label="y(x)") # a most basic plot + +#- + +@df df density(:x, label="") # density plot + +#- + +@df df histogram(:y, label="y") # and a histogram + +#- + +@df df boxplot(:z, :x, label="x") + +#- + +@df df violin(:z, :y, label="y") + diff --git a/literate_notebooks/src/01_constructors.jl b/literate_notebooks/src/01_constructors.jl new file mode 100644 index 0000000..333a81e --- /dev/null +++ b/literate_notebooks/src/01_constructors.jl @@ -0,0 +1,143 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** +# +# Let's get started by loading the `DataFrames` package. + +using DataFrames + +# ## Constructors and conversion + +#- + +# ### Constructors +# +# In this section, you'll see many ways to create a `DataFrame` using the `DataFrame()` constructor. +# +# First, we could create an empty DataFrame, + +DataFrame() # empty DataFrame + +# Or we could call the constructor using keyword arguments to add columns to the `DataFrame`. + +DataFrame(A=1:3, B=rand(3), C=randstring.([3,3,3])) + +# We can create a `DataFrame` from a dictionary, in which case keys from the dictionary will be sorted to create the `DataFrame` columns. + +x = Dict("A" => [1,2], "B" => [true, false], "C" => ['a', 'b']) +DataFrame(x) + +# Rather than explicitly creating a dictionary first, as above, we could pass `DataFrame` arguments with the syntax of dictionary key-value pairs. +# +# Note that in this case, we use symbols to denote the column names and arguments are not sorted. For example, `:A`, the symbol, produces `A`, the name of the first column here: + +DataFrame(:A => [1,2], :B => [true, false], :C => ['a', 'b']) + +# Here we create a `DataFrame` from a vector of vectors, and each vector becomes a column. + +DataFrame([rand(3) for i in 1:3]) + +# For now we can construct a single `DataFrame` from a `Vector` of atoms, creating a `DataFrame` with a single row. In future releases of DataFrames.jl, this will throw an error. + +DataFrame(rand(3)) + +# Instead use a transposed vector if you have a vector of atoms (in this way you effectively pass a two dimensional array to the constructor which is supported). + +DataFrame(transpose([1, 2, 3])) + +# Pass a second argument to give the columns names. + +DataFrame([1:3, 4:6, 7:9], [:A, :B, :C]) + +# Here we create a `DataFrame` from a matrix, + +DataFrame(rand(3,4)) + +# and here we do the same but also pass column names. + +DataFrame(rand(3,4), Symbol.('a':'d')) + +# We can also construct an uninitialized DataFrame. +# +# Here we pass column types, names and number of rows; we get `missing` in column :C because `Any >: Missing`. + +DataFrame([Int, Float64, Any], [:A, :B, :C], 1) + +# Here we create a `DataFrame`, but column `:C` is #undef and Jupyter has problem with displaying it. (This works OK at the REPL.) +# +# This will be fixed in next release of DataFrames! + +DataFrame([Int, Float64, String], [:A, :B, :C], 1) + +# To initialize a `DataFrame` with column names, but no rows use + +DataFrame([Int, Float64, String], [:A, :B, :C], 0) + +# This syntax gives us a quick way to create homogenous `DataFrame`. + +DataFrame(Int, 3, 5) + +# This example is similar, but has nonhomogenous columns. + +DataFrame([Int, Float64], 4) + +# Finally, we can create a `DataFrame` by copying an existing `DataFrame`. +# +# Note that `copy` creates a shallow copy. + +y = DataFrame(x) +z = copy(x) +(x === y), (x === z), isequal(x, z) + +# ### Conversion to a matrix +# +# Let's start by creating a `DataFrame` with two rows and two columns. + +x = DataFrame(x=1:2, y=["A", "B"]) + +# We can create a matrix by passing this `DataFrame` to `Matrix`. + +Matrix(x) + +# This would work even if the `DataFrame` had some `missing`s: + +x = DataFrame(x=1:2, y=[missing,"B"]) + +#- + +Matrix(x) + +# In the two previous matrix examples, Julia created matrices with elements of type `Any`. We can see more clearly that the type of matrix is inferred when we pass, for example, a `DataFrame` of integers to `Matrix`, creating a 2D `Array` of `Int64`s: + +x = DataFrame(x=1:2, y=3:4) + +#- + +Matrix(x) + +# In this next example, Julia correctly identifies that `Union` is needed to express the type of the resulting `Matrix` (which contains `missing`s). + +x = DataFrame(x=1:2, y=[missing,4]) + +#- + +Matrix(x) + +# Note that we can't force a conversion of `missing` values to `Int`s! + +Matrix{Int}(x) + +# ### Handling of duplicate column names +# +# We can pass the `makeunique` keyword argument to allow passing duplicate names (they get deduplicated) + +df = DataFrame(:a=>1, :a=>2, :a_1=>3; makeunique=true) + +# Otherwise, duplicates will not be allowed in the future. + +df = DataFrame(:a=>1, :a=>2, :a_1=>3) + +# A constructor that is passed column names as keyword arguments is a corner case. +# You cannot pass `makeunique` to allow duplicates here. + +df = DataFrame(a=1, a=2, makeunique=true) + diff --git a/literate_notebooks/src/02_basicinfo.jl b/literate_notebooks/src/02_basicinfo.jl new file mode 100644 index 0000000..6cde7c6 --- /dev/null +++ b/literate_notebooks/src/02_basicinfo.jl @@ -0,0 +1,76 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** + +using DataFrames # load package + +# ## Getting basic information about a data frame +# +# Let's start by creating a `DataFrame` object, `x`, so that we can learn how to get information on that data frame. + +x = DataFrame(A = [1, 2], B = [1.0, missing], C = ["a", "b"]) + +# The standard `size` function works to get dimensions of the `DataFrame`, + +size(x), size(x, 1), size(x, 2) + +# as well as `nrow` and `ncol` from R; `length` gives number of columns. + +nrow(x), ncol(x), length(x) + +# `describe` gives basic summary statistics of data in your `DataFrame`. + +describe(x) + +# Use `showcols` to get informaton about columns stored in a DataFrame. + +showcols(x) + +# `names` will return the names of all columns, + +names(x) + +# and `eltypes` returns their types. + +eltypes(x) + +# Here we create some large DataFrame + +y = DataFrame(rand(1:10, 1000, 10)); + +# and then we can use `head` to peek into its top rows + +head(y) + +# and `tail` to see its bottom rows. + +tail(y, 3) + +# ### Most elementary get and set operations +# +# Given the `DataFrame`, `x`, here are three ways to grab one of its columns as a `Vector`: + +x[1], x[:A], x[:, 1] + +# To grab one row as a DataFrame, we can index as follows. + +x[1, :] + +# We can grab a single cell or element with the same syntax to grab an element of an array. + +x[1, 1] + +# Assignment can be done in ranges to a scalar, + +x[1:2, 1:2] = 1 +x + +# to a vector of length equal to the number of assigned rows, + +x[1:2, 1:2] = [1,2] +x + +# or to another data frame of matching size. + +x[1:2, 1:2] = DataFrame([5 6; 7 8]) +x + diff --git a/literate_notebooks/src/03_missingvalues.jl b/literate_notebooks/src/03_missingvalues.jl new file mode 100644 index 0000000..1e17d97 --- /dev/null +++ b/literate_notebooks/src/03_missingvalues.jl @@ -0,0 +1,112 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** + +using DataFrames # load package + +# ## Handling missing values +# +# A singelton type `Missings.Missing` allows us to deal with missing values. + +missing, typeof(missing) + +# Arrays automatically create an appropriate union type. + +x = [1, 2, missing, 3] + +# `ismissing` checks if passed value is missing. + +ismissing(1), ismissing(missing), ismissing(x), ismissing.(x) + +# We can extract the type combined with Missing from a `Union` via +# +# (This is useful for arrays!) + +eltype(x), Missings.T(eltype(x)) + +# `missing` comparisons produce `missing`. + +missing == missing, missing != missing, missing < missing + +# This is also true when `missing`s are compared with values of other types. + +1 == missing, 1 != missing, 1 < missing + +# `isequal`, `isless`, and `===` produce results of type `Bool`. + +isequal(missing, missing), missing === missing, isequal(1, missing), isless(1, missing) + +# In the next few examples, we see that many (not all) functions handle `missing`. + +map(x -> x(missing), [sin, cos, zero, sqrt]) # part 1 + +#- + +map(x -> x(missing, 1), [+, - , *, /, div]) # part 2 + +#- + +map(x -> x([1,2,missing]), [minimum, maximum, extrema, mean, any, float]) # part 3 + +# `skipmissing` returns iterator skipping missing values. We can use `collect` and `skipmissing` to create an array that excludes these missing values. + +collect(skipmissing([1, missing, 2, missing])) + +# Similarly, here we combine `collect` and `Missings.replace` to create an array that replaces all missing values with some value (`NaN` in this case). + +collect(Missings.replace([1.0, missing, 2.0, missing], NaN)) + +# Another way to do this: + +coalesce.([1.0, missing, 2.0, missing], NaN) + +# Caution: `nothing` would also be replaced here (for Julia 0.7 a more sophisticated behavior of `coalesce` that allows to avoid this problem is planned). + +coalesce.([1.0, missing, nothing, missing], NaN) + +# You can use `recode` if you have homogenous output types. + +recode([1.0, missing, 2.0, missing], missing=>NaN) + +# You can use `unique` or `levels` to get unique values with or without missings, respectively. + +unique([1, missing, 2, missing]), levels([1, missing, 2, missing]) + +# In this next example, we convert `x` to `y` with `allowmissing`, where `y` has a type that accepts missings. + +x = [1,2,3] +y = allowmissing(x) + +# Then, we convert back with `disallowmissing`. This would fail if `y` contained missing values! + +z = disallowmissing(y) +x,y,z + +# In this next example, we show that the type of each column in `x` is initially `Int64`. After using `allowmissing!` to accept missing values in columns 1 and 3, the types of those columns become `Union`s of `Int64` and `Missings.Missing`. + +x = DataFrame(Int, 2, 3) +println("Before: ", eltypes(x)) +allowmissing!(x, 1) # make first column accept missings +allowmissing!(x, :x3) # make :x3 column accept missings +println("After: ", eltypes(x)) + +# In this next example, we'll use `completecases` to find all the rows of a `DataFrame` that have complete data. + +x = DataFrame(A=[1, missing, 3, 4], B=["A", "B", missing, "C"]) +println(x) +println("Complete cases:\n", completecases(x)) + +# We can use `dropmissing` or `dropmissing!` to remove the rows with incomplete data from a `DataFrame` and either create a new `DataFrame` or mutate the original in-place. + +y = dropmissing(x) +dropmissing!(x) +[x, y] + +# When we call `showcols` on a `DataFrame` with dropped missing values, the columns still allow missing values. + +showcols(x) + +# Since we've excluded missing values, we can safely use `disallowmissing!` so that the columns will no longer accept missing values. + +disallowmissing!(x) +showcols(x) + diff --git a/literate_notebooks/src/04_loadsave.jl b/literate_notebooks/src/04_loadsave.jl new file mode 100644 index 0000000..d166830 --- /dev/null +++ b/literate_notebooks/src/04_loadsave.jl @@ -0,0 +1,64 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** + +using DataFrames # load package + +# ## Load and save DataFrames +# We do not cover all features of the packages. Please refer to their documentation to learn them. +# +# Here we'll load `CSV` to read and write CSV files and `JLD`, which allows us to work with a Julia native binary format. + +using CSV +using JLD + +# Let's create a simple `DataFrame` for testing purposes, + +x = DataFrame(A=[true, false, true], B=[1, 2, missing], + C=[missing, "b", "c"], D=['a', missing, 'c']) + + +# and use `eltypes` to look at the columnwise types. + +eltypes(x) + +# Let's use `CSV` to save `x` to disk; make sure `x.csv` does not conflict with some file in your working directory. + +CSV.write("x.csv", x) + +# Now we can see how it was saved by reading `x.csv`. + +print(read("x.csv", String)) + +# We can also load it back. `use_mmap=false` disables memory mapping so that on Windows the file can be deleted in the same session. + +y = CSV.read("x.csv", use_mmap=false) + +# When loading in a `DataFrame` from a `CSV`, all columns allow `Missing` by default. Note that the column types have changed! + +eltypes(y) + +# Now let's save `x` to a file in a binary format; make sure that `x.jld` does not exist in your working directory. + +save("x.jld", "x", x) + +# After loading in `x.jld` as `y`, `y` is identical to `x`. + +y = load("x.jld", "x") + +# Note that the column types of `y` are the same as those of `x`! + +eltypes(y) + +# Next, we'll create the files `bigdf.csv` and `bigdf.jld`, so be careful that you don't already have these files on disc! +# +# In particular, we'll time how long it takes us to write a `DataFrame` with 10^3 rows and 10^5 columns to `.csv` and `.jld` files. *You can expect JLD to be faster!* Use `compress=true` to reduce file sizes. + +bigdf = DataFrame(Bool, 10^3, 10^2) +@time CSV.write("bigdf.csv", bigdf) +@time save("bigdf.jld", "bigdf", bigdf) +getfield.(stat.(["bigdf.csv", "bigdf.jld"]), :size) + +# Finally, let's clean up. Do not run the next cell unless you are sure that it will not erase your important files. + +foreach(rm, ["x.csv", "x.jld", "bigdf.csv", "bigdf.jld"]) + diff --git a/literate_notebooks/src/05_columns.jl b/literate_notebooks/src/05_columns.jl new file mode 100644 index 0000000..f32e02a --- /dev/null +++ b/literate_notebooks/src/05_columns.jl @@ -0,0 +1,187 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** + +using DataFrames # load package + +# ## Manipulating columns of DataFrame + +#- + +# ### Renaming columns +# +# Let's start with a `DataFrame` of `Bool`s that has default column names. + +x = DataFrame(Bool, 3, 4) + +# With `rename`, we create new `DataFrame`; here we rename the column `:x1` to `:A`. (`rename` also accepts collections of Pairs.) + +rename(x, :x1 => :A) + +# With `rename!` we do an in place transformation. +# +# This time we've applied a function to every column name. + +rename!(c -> Symbol(string(c)^2), x) + +# We can also change the name of a particular column without knowing the original. +# +# Here we change the name of the third column, creating a new `DataFrame`. + +rename(x, names(x)[3] => :third) + +# With `names!`, we can change the names of all variables. + +names!(x, [:a, :b, :c, :d]) + +# We get an error when we try to provide duplicate names + +names!(x, fill(:a, 4)) + +# unless we pass `makeunique=true`, which allows us to handle duplicates in passed names. + +names!(x, fill(:a, 4), makeunique=true) + +# ### Reordering columns + +#- + +# We can reorder the names(x) vector as needed, creating a new DataFrame. + +srand(1234) +x[shuffle(names(x))] + +# also `permutecols!` will be introduced in next release of DataFrames + +#- + +# ### Merging/adding columns + +x = DataFrame([(i,j) for i in 1:3, j in 1:4]) + +# With `hcat` we can merge two `DataFrame`s. Also [x y] syntax is supported but only when DataFrames have unique column names. + +hcat(x, x, makeunique=true) + +# We can also use `hcat` to add a new column; a default name `:x1` will be used for this column, so `makeunique=true` is needed. + +y = hcat(x, [1,2,3], makeunique=true) + +# You can also prepend a vector with `hcat`. + +hcat([1,2,3], x, makeunique=true) + +# Alternatively you could append a vector with the following syntax. This is a bit more verbose but cleaner. + +y = [x DataFrame(A=[1,2,3])] + +# Here we do the same but add column `:A` to the front. + +y = [DataFrame(A=[1,2,3]) x] + +# A column can also be added in the middle. Here a brute-force method is used and a new DataFrame is created. + +using BenchmarkTools +@btime [$x[1:2] DataFrame(A=[1,2,3]) $x[3:4]] + +# We could also do this with a specialized in place method `insert!`. Let's add `:newcol` to the `DataFrame` `y`. + +insert!(y, 2, [1,2,3], :newcol) + +# If you want to insert the same column name several times `makeunique=true` is needed as usual. + +insert!(y, 2, [1,2,3], :newcol, makeunique=true) + +# We can see how much faster it is to insert a column with `insert!` than with `hcat` using `@btime`. + +@btime insert!(copy($x), 3, [1,2,3], :A) + +# Let's use `insert!` to append a column in place, + +insert!(x, ncol(x)+1, [1,2,3], :A) + +# and to in place prepend a column. + +insert!(x, 1, [1,2,3], :B) + +# With `merge!`, let's merge the second DataFrame into first, but overwriting duplicates. + +df1 = DataFrame(x=1:3, y=4:6) +df2 = DataFrame(x='a':'c', z = 'd':'f', new=11:13) +df1, df2, merge!(df1, df2) + +# For comparison: merge two `DataFrames`s but renaming duplicate names via `hcat`. + +df1 = DataFrame(x=1:3, y=4:6) +df2 = DataFrame(x='a':'c', z = 'd':'f', new=11:13) +hcat(df1, df2, makeunique=true) + +# ### Subsetting/removing columns +# +# Let's create a new `DataFrame` `x` and show a few ways to create DataFrames with a subset of `x`'s columns. + +x = DataFrame([(i,j) for i in 1:3, j in 1:5]) + +# First we could do this by index + +x[[1,2,4,5]] + +# or by column name. + +x[[:x1, :x4]] + +# We can also choose to keep or exclude columns by `Bool`. (We need a vector whose length is the number of columns in the original `DataFrame`.) + +x[[true, false, true, false, true]] + +# Here we create a single column `DataFrame`, + +x[[:x1]] + +# and here we access the vector contained in column `:x1`. + +x[:x1] + +# We could grab the same vector by column number + +x[1] + +# and remove everything from a `DataFrame` with `empty!`. + +empty!(y) + +# Here we create a copy of `x` and delete the 3rd column from the copy with `delete!`. + +z = copy(x) +x, delete!(z, 3) + +# ### Modify column by name + +x = DataFrame([(i,j) for i in 1:3, j in 1:5]) + +# With the following syntax, the existing column is modified without performing any copying. + +x[:x1] = x[:x2] +x + +# We can also use the following syntax to add a new column at the end of a `DataFrame`. + +x[:A] = [1,2,3] +x + +# A new column name will be added to our `DataFrame` with the following syntax as well (7 is equal to `ncol(x)+1`). + +x[7] = 11:13 +x + +# ### Find column name + +x = DataFrame([(i,j) for i in 1:3, j in 1:5]) + +# We can check if a column with a given name exists via + +:x1 in names(x) + +# and determine its index via + +findfirst(names(x), :x2) + diff --git a/literate_notebooks/src/06_rows.jl b/literate_notebooks/src/06_rows.jl new file mode 100644 index 0000000..3660e40 --- /dev/null +++ b/literate_notebooks/src/06_rows.jl @@ -0,0 +1,177 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames # load package +srand(1); + +# ## Manipulating rows of DataFrame + +#- + +# ### Reordering rows + +x = DataFrame(id=1:10, x = rand(10), y = [zeros(5); ones(5)]) # and we hope that x[:x] is not sorted :) + +#- + +issorted(x), issorted(x, :x) # check if a DataFrame or a subset of its columns is sorted + +#- + +sort!(x, :x) # sort x in place + +#- + +y = sort(x, :id) # new DataFrame + +#- + +sort(x, (:y, :x), rev=(true, false)) # sort by two columns, first is decreasing, second is increasing + +#- + +sort(x, (order(:y, rev=true), :x)) # the same as above + +#- + +sort(x, (order(:y, rev=true), order(:x, by=v->-v))) # some more fancy sorting stuff + +#- + +x[shuffle(1:10), :] # reorder rows (here randomly) + +#- + +sort!(x, :id) +x[[1,10],:] = x[[10,1],:] # swap rows +x + +#- + +x[1,:], x[10,:] = x[10,:], x[1,:] # and swap again +x + +# ### Merging/adding rows + +x = DataFrame(rand(3, 5)) + +#- + +[x; x] # merge by rows - data frames must have the same column names; the same is vcat + +#- + +y = x[reverse(names(x))] # get y with other order of names + +#- + +vcat(x, y) # we get what we want as vcat does column name matching + +#- + +vcat(x, y[1:3]) # but column names must still match + +#- + +append!(x, x) # the same but modifies x + +#- + +append!(x, y) # here column names must match exactly + +#- + +push!(x, 1:5) # add one row to x at the end; must give correct number of values and correct types +x + +#- + +push!(x, Dict(:x1=> 11, :x2=> 12, :x3=> 13, :x4=> 14, :x5=> 15)) # also works with dictionaries +x + +# ### Subsetting/removing rows + +x = DataFrame(id=1:10, val='a':'j') + +#- + +x[1:2, :] # by index + +#- + +view(x, 1:2) # the same but a view + +#- + +x[repmat([true, false], 5), :] # by Bool, exact length required + +#- + +view(x, repmat([true, false], 5), :) # view again + +#- + +deleterows!(x, 7) # delete one row + +#- + +deleterows!(x, 6:7) # delete a collection of rows + +#- + +x = DataFrame([1:4, 2:5, 3:6]) + +#- + +filter(r -> r[:x1] > 2.5, x) # create a new DataFrame where filtering function operates on DataFrameRow + +#- + +## in place modification of x, an example with do-block syntax +filter!(x) do r + if r[:x1] > 2.5 + return r[:x2] < 4.5 + end + r[:x3] < 3.5 +end + +# ### Deduplicating + +x = DataFrame(A=[1,2], B=["x","y"]) +append!(x, x) +x[:C] = 1:4 +x + +#- + +unique(x, [1,2]) # get first unique rows for given index + +#- + +unique(x) # now we look at whole rows + +#- + +nonunique(x, :A) # get indicators of non-unique rows + +#- + +unique!(x, :B) # modify x in place + +# ### Extracting one row from `DataFrame` into a vector + +x = DataFrame(x=[1,missing,2], y=["a", "b", missing], z=[true,false,true]) + +#- + +cols = [:x, :y] +[x[1, col] for col in cols] # subset of columns + +#- + +[[x[i, col] for col in names(x)] for i in 1:nrow(x)] # vector of vectors, each entry contains one full row of x + +#- + +Tuple(x[1, col] for col in cols) # similar construct for Tuples, when ported to Julia 0.7 NamedTuples will be added + diff --git a/literate_notebooks/src/07_factors.jl b/literate_notebooks/src/07_factors.jl new file mode 100644 index 0000000..a3ff03c --- /dev/null +++ b/literate_notebooks/src/07_factors.jl @@ -0,0 +1,231 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames # load package + +# ## Working with CategoricalArrays + +#- + +# ### Constructor + +x = categorical(["A", "B", "B", "C"]) # unordered + +#- + +y = categorical(["A", "B", "B", "C"], ordered=true) # ordered, by default order is sorting order + +#- + +z = categorical(["A","B","B","C", missing]) # unordered with missings + +#- + +c = cut(1:10, 5) # ordered, into equal counts, possible to rename labels and give custom breaks + +#- + +by(DataFrame(x=cut(randn(100000), 10)), :x, d -> DataFrame(n=nrow(d)), sort=true) # just to make sure it works right + +#- + +v = categorical([1,2,2,3,3]) # contains integers not strings + +#- + +Vector{Union{String, Missing}}(z) # sometimes you need to convert back to a standard vector + +# ### Managing levels + +arr = [x,y,z,c,v] + +#- + +isordered.(arr) # chcek if categorical array is orderd + +#- + +ordered!(x, true), isordered(x) # make x ordered + +#- + +ordered!(x, false), isordered(x) # and unordered again + +#- + +levels.(arr) # list levels + +#- + +unique.(arr) # missing will be included + +#- + +y[1] < y[2] # can compare as y is ordered + +#- + +v[1] < v[2] # not comparable, v is unordered although it contains integers + +#- + +levels!(y, ["C", "B", "A"]) # you can reorder levels, mostly useful for ordered CategoricalArrays + +#- + +y[1] < y[2] # observe that the order is changed + +#- + +levels!(z, ["A", "B"]) # you have to specify all levels that are present + +#- + +levels!(z, ["A", "B"], allow_missing=true) # unless the underlying array allows for missings and force removal of levels + +#- + +z[1] = "B" +z # now z has only "B" entries + +#- + +levels(z) # but it remembers the levels it had (the reason is mostly performance) + +#- + +droplevels!(z) # this way we can clean it up +levels(z) + +# ### Data manipulation + +x, levels(x) + +#- + +x[2] = "0" +x, levels(x) # new level added at the end (works only for unordered) + +#- + +v, levels(v) + +#- + +v[1] + v[2] # even though underlying data is Int, we cannot operate on it + +#- + +Vector{Int}(v) # you have either to retrieve the data by conversion (may be expensive) + +#- + +get(v[1]) + get(v[2]) # or get a single value + +#- + +get.(v) # this will work for arrays witout missings + +#- + +get.(z) # but will fail on missing values + +#- + +Vector{Union{String, Missing}}(z) # you have to do the conversion + +#- + +z[1]*z[2], z.^2 # the only exception are CategoricalArrays based on String - you can operate on them normally + +#- + +recode([1,2,3,4,5,missing], 1=>10) # recode some values in an array; has also in place recode! equivalent + +#- + +recode([1,2,3,4,5,missing], "a", 1=>10, 2=>20) # here we provided a default value for not mapped recodings + +#- + +recode([1,2,3,4,5,missing], 1=>10, missing=>"missing") # to recode Missing you have to do it explicitly + +#- + +t = categorical([1:5; missing]) +t, levels(t) + +#- + +recode!(t, [1,3]=>2) +t, levels(t) # note that the levels are dropped after recode + +#- + +t = categorical([1,2,3], ordered=true) +levels(recode(t, 2=>0, 1=>-1)) # and if you introduce a new levels they are added at the end in the order of appearance + +#- + +t = categorical([1,2,3,4,5], ordered=true) # when using default it becomes the last level +levels(recode(t, 300, [1,2]=>100, 3=>200)) + +# ### Comparisons + +x = categorical([1,2,3]) +xs = [x, categorical(x), categorical(x, ordered=true), categorical(x, ordered=true)] +levels!(xs[2], [3,2,1]) +levels!(xs[4], [2,3,1]) +[a == b for a in xs, b in xs] # all are equal - comparison only by contents + +#- + +signature(x::CategoricalArray) = (x, levels(x), isordered(x)) # this is actually the full signature of CategoricalArray +## all are different, notice that x[1] and x[2] are unordered but have a different order of levels +[signature(a) == signature(b) for a in xs, b in xs] + +#- + +x[1] < x[2] # you cannot compare elements of unordered CategoricalArray + +#- + +t[1] < t[2] # but you can do it for an ordered one + +#- + +isless(x[1], x[2]) # isless works within the same CategoricalArray even if it is not ordered + +#- + +y = deepcopy(x) # but not across categorical arrays +isless(x[1], y[2]) + +#- + +isless(get(x[1]), get(y[2])) # you can use get to make a comparison of the contents of CategoricalArray + +#- + +x[1] == y[2] # equality tests works OK across CategoricalArrays + +# ### Categorical columns in a DataFrame + +df = DataFrame(x = 1:3, y = 'a':'c', z = ["a","b","c"]) + +#- + +categorical!(df) # converts all eltype(AbstractString) columns to categorical + +#- + +showcols(df) + +#- + +categorical!(df, :x) # manually convert to categorical column :x + +#- + +showcols(df) + diff --git a/literate_notebooks/src/08_joins.jl b/literate_notebooks/src/08_joins.jl new file mode 100644 index 0000000..e52bc22 --- /dev/null +++ b/literate_notebooks/src/08_joins.jl @@ -0,0 +1,76 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2017** + +using DataFrames # load package + +# ## Joining DataFrames + +#- + +# ### Preparing DataFrames for a join + +x = DataFrame(ID=[1,2,3,4,missing], name = ["Alice", "Bob", "Conor", "Dave","Zed"]) +y = DataFrame(id=[1,2,5,6,missing], age = [21,22,23,24,99]) +x,y + +#- + +rename!(x, :ID=>:id) # names of columns on which we want to join must be the same + +# ### Standard joins: inner, left, right, outer, semi, anti + +join(x, y, on=:id) # :inner join by default, missing is joined + +#- + +join(x, y, on=:id, kind=:left) + +#- + +join(x, y, on=:id, kind=:right) + +#- + +join(x, y, on=:id, kind=:outer) + +#- + +join(x, y, on=:id, kind=:semi) + +#- + +join(x, y, on=:id, kind=:anti) + +# ### Cross join + +## cross-join does not require on argument +## it produces a Cartesian product or arguments +function expand_grid(;xs...) # a simple replacement for expand.grid in R + reduce((x,y) -> join(x, DataFrame(Pair(y...)), kind=:cross), + DataFrame(Pair(xs[1]...)), xs[2:end]) +end + +expand_grid(a=[1,2], b=["a","b","c"], c=[true,false]) + +# ### Complex cases of joins + +x = DataFrame(id1=[1,1,2,2,missing,missing], + id2=[1,11,2,21,missing,99], + name = ["Alice", "Bob", "Conor", "Dave","Zed", "Zoe"]) +y = DataFrame(id1=[1,1,3,3,missing,missing], + id2=[11,1,31,3,missing,999], + age = [21,22,23,24,99, 100]) +x,y + +#- + +join(x, y, on=[:id1, :id2]) # joining on two columns + +#- + +join(x, y, on=[:id1], makeunique=true) # with duplicates all combinations are produced (here :inner join) + +#- + +join(x, y, on=[:id1], kind=:semi) # but not by :semi join (as it would duplicate rows) + diff --git a/literate_notebooks/src/09_reshaping.jl b/literate_notebooks/src/09_reshaping.jl new file mode 100644 index 0000000..d6ec25b --- /dev/null +++ b/literate_notebooks/src/09_reshaping.jl @@ -0,0 +1,90 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames # load package + +# ## Reshaping DataFrames + +#- + +# ### Wide to long + +x = DataFrame(id=[1,2,3,4], id2=[1,1,2,2], M1=[11,12,13,14], M2=[111,112,113,114]) + +#- + +melt(x, :id, [:M1, :M2]) # first pass id-variables and then measure variables; meltdf makes a view + +#- + +## optionally you can rename columns; melt and stack are identical but order of arguments is reversed +stack(x, [:M1, :M2], :id, variable_name=:key, value_name=:observed) # first measures and then id-s; stackdf creates view + +#- + +## if second argument is omitted in melt or stack , all other columns are assumed to be the second argument +## but measure variables are selected only if they are <: AbstractFloat +melt(x, [:id, :id2]) + +#- + +melt(x, [1, 2]) # you can use index instead of symbol + +#- + +bigx = DataFrame(rand(10^6, 10)) # a test comparing creation of new DataFrame and a view +bigx[:id] = 1:10^6 +@time melt(bigx, :id) +@time melt(bigx, :id) +@time meltdf(bigx, :id) +@time meltdf(bigx, :id); + +#- + +x = DataFrame(id = [1,1,1], id2=['a','b','c'], a1 = rand(3), a2 = rand(3)) + +#- + +melt(x) + +#- + +melt(DataFrame(rand(3,2))) # by default stack and melt treats floats as value columns + +#- + +df = DataFrame(rand(3,2)) +df[:key] = [1,1,1] +mdf = melt(df) # duplicates in key are silently accepted + +# ### Long to wide + +x = DataFrame(id = [1,1,1], id2=['a','b','c'], a1 = rand(3), a2 = rand(3)) + +#- + +y = melt(x, [1,2]) +display(x) +display(y) + +#- + +unstack(y, :id2, :variable, :value) # stndard unstack with a unique key + +#- + +unstack(y, :variable, :value) # all other columns are treated as keys + +#- + +## by default :id, :variable and :value names are assumed; in this case it produces duplicate keys +unstack(y) + +#- + +df = stack(DataFrame(rand(3,2))) + +#- + +unstack(df, :variable, :value) # unable to unstack when no key column is present + diff --git a/literate_notebooks/src/10_transforms.jl b/literate_notebooks/src/10_transforms.jl new file mode 100644 index 0000000..3b5b4aa --- /dev/null +++ b/literate_notebooks/src/10_transforms.jl @@ -0,0 +1,80 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames # load package + +# ## Split-apply-combine + +x = DataFrame(id=[1,2,3,4,1,2,3,4], id2=[1,2,1,2,1,2,1,2], v=rand(8)) + +#- + +gx1 = groupby(x, :id) + +#- + +gx2 = groupby(x, [:id, :id2]) + +#- + +vcat(gx2...) # back to the original DataFrame + +#- + +x = DataFrame(id = [missing, 5, 1, 3, missing], x = 1:5) + +#- + +showall(groupby(x, :id)) # by default groups include mising values and are not sorted + +#- + +showall(groupby(x, :id, sort=true, skipmissing=true)) # but we can change it :) + +#- + +x = DataFrame(id=rand('a':'d', 100), v=rand(100)); +by(x, :id, y->mean(y[:v])) # apply a function to each group of a data frame + +#- + +by(x, :id, y->mean(y[:v]), sort=true) # we can sort the output + +#- + +by(x, :id, y->DataFrame(res=mean(y[:v]))) # this way we can set a name for a column - DataFramesMeta @by is better + +#- + +x = DataFrame(id=rand('a':'d', 100), x1=rand(100), x2=rand(100)) +aggregate(x, :id, sum) # apply a function over all columns of a data frame in groups given by id + +#- + +aggregate(x, :id, sum, sort=true) # also can be sorted + +# *We omit the discussion of of map/combine as I do not find them very useful (better to use by)* + +x = DataFrame(rand(3, 5)) + +#- + +map(mean, eachcol(x)) # map a function over each column and return a data frame + +#- + +foreach(c -> println(c[1], ": ", mean(c[2])), eachcol(x)) # a raw iteration returns a tuple with column name and values + +#- + +colwise(mean, x) # colwise is similar, but produces a vector + +#- + +x[:id] = [1,1,2] +colwise(mean,groupby(x, :id)) # and works on GroupedDataFrame + +#- + +map(r -> r[:x1]/r[:x2], eachrow(x)) # now the returned value is DataFrameRow which works similarly to a one-row DataFrame + diff --git a/literate_notebooks/src/11_performance.jl b/literate_notebooks/src/11_performance.jl new file mode 100644 index 0000000..005e877 --- /dev/null +++ b/literate_notebooks/src/11_performance.jl @@ -0,0 +1,135 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames +using BenchmarkTools + +# ## Performance tips + +#- + +# ### Access by column number is faster than by name + +x = DataFrame(rand(5, 1000)) +@btime x[500]; +@btime x[:x500]; + +# ### When working with data `DataFrame` use barrier functions or type annotation + +function f_bad() # this function will be slow + srand(1); x = DataFrame(rand(1000000,2)) + y, z = x[1], x[2] + p = 0.0 + for i in 1:nrow(x) + p += y[i]*z[i] + end + p +end + +@btime f_bad(); + +#- + +@code_warntype f_bad() # the reason is that Julia does not know the types of columns in `DataFrame` + +#- + +## solution 1 is to use barrier function (it should be possible to use it in almost any code) +function f_inner(y,z) + p = 0.0 + for i in 1:length(y) + p += y[i]*z[i] + end + p +end + +function f_barrier() # extract the work to an inner function + srand(1); x = DataFrame(rand(1000000,2)) + f_inner(x[1], x[2]) +end + +function f_inbuilt() # or use inbuilt function if possible + srand(1); x = DataFrame(rand(1000000,2)) + dot(x[1], x[2]) +end + +@btime f_barrier(); +@btime f_inbuilt(); + +#- + +## solution 2 is to provide the types of extracted columns +## it is simpler but there are cases in which you will not know these types +function f_typed() + srand(1); x = DataFrame(rand(1000000,2)) + y::Vector{Float64}, z::Vector{Float64} = x[1], x[2] + p = 0.0 + for i in 1:nrow(x) + p += y[i]*z[i] + end + p +end + +@btime f_typed(); + +# ### Consider using delayed `DataFrame` creation technique + +function f1() + x = DataFrame(Float64, 10^4, 100) # we work with DataFrame directly + for c in 1:ncol(x) + d = x[c] + for r in 1:nrow(x) + d[r] = rand() + end + end + x +end + +function f2() + x = Vector{Any}(100) + for c in 1:length(x) + d = Vector{Float64}(10^4) + for r in 1:length(d) + d[r] = rand() + end + x[c] = d + end + DataFrame(x) # we delay creation of DataFrame after we have our job done +end + +@btime f1(); +@btime f2(); + +# ### You can add rows to a `DataFrame` in place and it is fast + +x = DataFrame(rand(10^6, 5)) +y = DataFrame(transpose(1.0:5.0)) +z = [1.0:5.0;] + +@btime vcat($x, $y); # creates a new DataFrame - slow +@btime append!($x, $y); # in place - fast + +x = DataFrame(rand(10^6, 5)) # reset to the same starting point +@btime push!($x, $z); # add a single row in place - fastest + +# ### Allowing `missing` as well as `categorical` slows down computations + +using StatsBase + +function test(data) # uses countmap function to test performance + println(eltype(data)) + x = rand(data, 10^6) + y = categorical(x) + println(" raw:") + @btime countmap($x) + println(" categorical:") + @btime countmap($y) + nothing +end + +test(1:10) +test([randstring() for i in 1:10]) +test(allowmissing(1:10)) +test(allowmissing([randstring() for i in 1:10])) + + diff --git a/literate_notebooks/src/12_pitfalls.jl b/literate_notebooks/src/12_pitfalls.jl new file mode 100644 index 0000000..8eb5e79 --- /dev/null +++ b/literate_notebooks/src/12_pitfalls.jl @@ -0,0 +1,73 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** + +using DataFrames + +# ## Possible pitfalls + +#- + +# ### Know what is copied when creating a `DataFrame` + +x = DataFrame(rand(3, 5)) + +#- + +y = DataFrame(x) +x === y # no copyinng performed + +#- + +y = copy(x) +x === y # not the same object + +#- + +all(x[i] === y[i] for i in ncol(x)) # but the columns are the same + +#- + +x = 1:3; y = [1, 2, 3]; df = DataFrame(x=x,y=y) # the same when creating arrays or assigning columns, except ranges + +#- + +y === df[:y] # the same object + +#- + +typeof(x), typeof(df[:x]) # range is converted to a vector + +# ### Do not modify the parent of `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 + +# ### Remember that you can filter columns of a `DataFrame` using booleans + +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, :] # probably this is what we wanted + +# ### Column selection for DataFrame creates aliases unless explicitly copied + +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 +display(x) +x[1,1] = 100 +display(x) + diff --git a/literate_notebooks/src/13_extras.jl b/literate_notebooks/src/13_extras.jl new file mode 100644 index 0000000..5140a31 --- /dev/null +++ b/literate_notebooks/src/13_extras.jl @@ -0,0 +1,198 @@ +# # Introduction to DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 13, 2018** + +using DataFrames + +# ## Extras - selected functionalities of selected packages + +#- + +# ### FreqTables: creating cross tabulations + +using FreqTables +df = DataFrame(a=rand('a':'d', 1000), b=rand(["x", "y", "z"], 1000)) +ft = freqtable(df, :a, :b) # observe that dimensions are sorted if possible + +#- + +ft[1,1], ft['b', "z"] # you can index the result using numbers or names + +#- + +prop(ft, 1) # getting proportions - 1 means we want to calculate them in rows (first dimension) + +#- + +prop(ft, 2) # and columns are normalized to 1.0 now + +#- + +x = categorical(rand(1:3, 10)) +levels!(x, [3, 1, 2, 4]) # reordering levels and adding an extra level +freqtable(x) # order is preserved and not-used level is shown + +#- + +freqtable([1,1,2,3,missing]) # by default missings are listed + +#- + +freqtable([1,1,2,3,missing], skipmissing=true) # but we can skip them + +# ### DataFramesMeta - working on `DataFrame` + +using DataFramesMeta +df = DataFrame(x=1:8, y='a':'h', z=repeat([true,false], outer=4)) + +#- + +@with(df, :x+:z) # expressions with columns of DataFrame + +#- + +@with df begin # you can define code blocks + a = :x[:z] + b = :x[.!:z] + :y + [a; b] +end + +#- + +a # @with creates hard scope so variables do not leak out + +#- + +df2 = DataFrame(a = [:a, :b, :c]) +@with(df2, :a .== ^(:a)) # sometimes we want to work on raw Symbol, ^() escapes it + +#- + +df2 = DataFrame(x=1:3, y=4:6, z=7:9) +@with(df2, _I_(2:3)) # _I_(expression) is translated to df2[expression] + +#- + +@where(df, :x .< 4, :z .== true) # very useful macro for filtering + +#- + +@select(df, :x, y = 2*:x, z=:y) # create a new DataFrame based on the old one + +#- + +@transform(df, a=1, x = 2*:x, y=:x) # create a new DataFrame adding columns based on the old one + +#- + +@transform(df, a=1, b=:a) # old DataFrame is used and :a is not present there + +#- + +@orderby(df, :z, -:x) # sorting into a new data frame, less powerful than sort, but lightweight + +#- + +@linq df |> # chaining of operations on DataFrame + where(:x .< 5) |> + orderby(:z) |> + transform(x²=:x.^2) |> + select(:z, :x, :x²) + +#- + +f(df, col) = df[col] # you can define your own functions and put them in the chain +@linq df |> where(:x .<= 4) |> f(:x) + +# ### DataFramesMeta - working on grouped `DataFrame` + +df = DataFrame(a = 1:12, b = repeat('a':'d', outer=3)) +g = groupby(df, :b) + +#- + +@by(df, :b, first=first(:a), last=last(:a), mean=mean(:a)) # more convinient than by from DataFrames + +#- + +@based_on(g, first=first(:a), last=last(:a), mean=mean(:a)) # the same as by but on grouped DataFrame + +#- + +@where(g, mean(:a) > 6.5) # filter gropus on aggregate conditions + +#- + +@orderby(g, -sum(:a)) # order groups on aggregate conditions + +#- + +@transform(g, center = mean(:a), centered = :a - mean(:a)) # perform operations within a group and return ungroped DataFrame + +#- + +DataFrame(g) # a nice convinience function not defined in DataFrames + +#- + +@transform(g) # actually this is the same + +#- + +@linq df |> groupby(:b) |> where(mean(:a) > 6.5) |> DataFrame # you can do chaining on grouped DataFrames as well + +# ### DataFramesMeta - rowwise operations on `DataFrame` + +df = DataFrame(a = 1:12, b = repeat(1:4, outer=3)) + +#- + +## such conditions are often needed but are complex to write +@transform(df, x = ifelse.((:a .> 6) .& (:b .== 4), "yes", "no")) + +#- + +## one option is to use a function that works on a single observation and broadcast it +myfun(a, b) = a > 6 && b == 4 ? "yes" : "no" +@transform(df, x = myfun.(:a, :b)) + +#- + +## or you can use @byrow! macro that allows you to process DataFrame rowwise +@byrow! df begin + @newcol x::Vector{String} + :x = :a > 6 && :b == 4 ? "yes" : "no" +end + +# ### Visualizing data with StatPlots + +using StatPlots # you might need to setup Plots package and some plotting backend first + +#- + +## we present only a minimal functionality of the package + +#- + +srand(1) +df = DataFrame(x = sort(randn(1000)), y=randn(1000), z = [fill("b", 500); fill("a", 500)]) + +#- + +@df df plot(:x, :y, legend=:topleft, label="y(x)") # a most basic plot + +#- + +@df df density(:x, label="") # density plot + +#- + +@df df histogram(:y, label="y") # and a histogram + +#- + +@df df boxplot(:z, :x, label="x") + +#- + +@df df violin(:z, :y, label="y") + From 703988bb7352730445f2906b0831a998d23338ae Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Sun, 18 Apr 2021 07:20:53 -0300 Subject: [PATCH 02/20] Fork from the spanish-tutorials literate notebooks creation --- literate_notebooks/{src-ES => src-PT-BR}/01_constructors.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/02_basicinfo.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/03_missingvalues.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/04_loadsave.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/05_columns.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/06_rows.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/07_factors.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/08_joins.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/09_reshaping.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/10_transforms.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/11_performance.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/12_pitfalls.jl | 0 literate_notebooks/{src-ES => src-PT-BR}/13_extras.jl | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename literate_notebooks/{src-ES => src-PT-BR}/01_constructors.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/02_basicinfo.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/03_missingvalues.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/04_loadsave.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/05_columns.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/06_rows.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/07_factors.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/08_joins.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/09_reshaping.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/10_transforms.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/11_performance.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/12_pitfalls.jl (100%) rename literate_notebooks/{src-ES => src-PT-BR}/13_extras.jl (100%) diff --git a/literate_notebooks/src-ES/01_constructors.jl b/literate_notebooks/src-PT-BR/01_constructors.jl similarity index 100% rename from literate_notebooks/src-ES/01_constructors.jl rename to literate_notebooks/src-PT-BR/01_constructors.jl diff --git a/literate_notebooks/src-ES/02_basicinfo.jl b/literate_notebooks/src-PT-BR/02_basicinfo.jl similarity index 100% rename from literate_notebooks/src-ES/02_basicinfo.jl rename to literate_notebooks/src-PT-BR/02_basicinfo.jl diff --git a/literate_notebooks/src-ES/03_missingvalues.jl b/literate_notebooks/src-PT-BR/03_missingvalues.jl similarity index 100% rename from literate_notebooks/src-ES/03_missingvalues.jl rename to literate_notebooks/src-PT-BR/03_missingvalues.jl diff --git a/literate_notebooks/src-ES/04_loadsave.jl b/literate_notebooks/src-PT-BR/04_loadsave.jl similarity index 100% rename from literate_notebooks/src-ES/04_loadsave.jl rename to literate_notebooks/src-PT-BR/04_loadsave.jl diff --git a/literate_notebooks/src-ES/05_columns.jl b/literate_notebooks/src-PT-BR/05_columns.jl similarity index 100% rename from literate_notebooks/src-ES/05_columns.jl rename to literate_notebooks/src-PT-BR/05_columns.jl diff --git a/literate_notebooks/src-ES/06_rows.jl b/literate_notebooks/src-PT-BR/06_rows.jl similarity index 100% rename from literate_notebooks/src-ES/06_rows.jl rename to literate_notebooks/src-PT-BR/06_rows.jl diff --git a/literate_notebooks/src-ES/07_factors.jl b/literate_notebooks/src-PT-BR/07_factors.jl similarity index 100% rename from literate_notebooks/src-ES/07_factors.jl rename to literate_notebooks/src-PT-BR/07_factors.jl diff --git a/literate_notebooks/src-ES/08_joins.jl b/literate_notebooks/src-PT-BR/08_joins.jl similarity index 100% rename from literate_notebooks/src-ES/08_joins.jl rename to literate_notebooks/src-PT-BR/08_joins.jl diff --git a/literate_notebooks/src-ES/09_reshaping.jl b/literate_notebooks/src-PT-BR/09_reshaping.jl similarity index 100% rename from literate_notebooks/src-ES/09_reshaping.jl rename to literate_notebooks/src-PT-BR/09_reshaping.jl diff --git a/literate_notebooks/src-ES/10_transforms.jl b/literate_notebooks/src-PT-BR/10_transforms.jl similarity index 100% rename from literate_notebooks/src-ES/10_transforms.jl rename to literate_notebooks/src-PT-BR/10_transforms.jl diff --git a/literate_notebooks/src-ES/11_performance.jl b/literate_notebooks/src-PT-BR/11_performance.jl similarity index 100% rename from literate_notebooks/src-ES/11_performance.jl rename to literate_notebooks/src-PT-BR/11_performance.jl diff --git a/literate_notebooks/src-ES/12_pitfalls.jl b/literate_notebooks/src-PT-BR/12_pitfalls.jl similarity index 100% rename from literate_notebooks/src-ES/12_pitfalls.jl rename to literate_notebooks/src-PT-BR/12_pitfalls.jl diff --git a/literate_notebooks/src-ES/13_extras.jl b/literate_notebooks/src-PT-BR/13_extras.jl similarity index 100% rename from literate_notebooks/src-ES/13_extras.jl rename to literate_notebooks/src-PT-BR/13_extras.jl From 60b375d5168b6c8331617589a2d4610435dd53c6 Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Sun, 18 Apr 2021 07:28:54 -0300 Subject: [PATCH 03/20] added original README.md for translation --- literate_notebooks/src-PT-BR/README.md | 147 +++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 literate_notebooks/src-PT-BR/README.md diff --git a/literate_notebooks/src-PT-BR/README.md b/literate_notebooks/src-PT-BR/README.md new file mode 100644 index 0000000..4733e5c --- /dev/null +++ b/literate_notebooks/src-PT-BR/README.md @@ -0,0 +1,147 @@ +# An Introduction to DataFrames + +[Bogumił Kamiński](http://bogumilkaminski.pl/about/), November 2020, 2020 + +**The tutorial is for DataFrames 0.22.1** + +A brief introduction to basic usage of [DataFrames](https://github.com/JuliaData/DataFrames.jl). + +The tutorial contains a specification of the project environment version under +which it should be run. In order to prepare this environment, before using the +tutorial notebooks, while in the project folder run the following command in the +command line: + +``` +julia -e 'using Pkg; Pkg.activate("."); Pkg.instantiate()' +``` + +Tested under Julia 1.5.3. The project dependencies are the following: + +``` + [69666777] Arrow v1.0.1 + [6e4b80f9] BenchmarkTools v0.5.0 + [336ed68f] CSV v0.8.2 + [324d7699] CategoricalArrays v0.9.0 + [944b1d66] CodecZlib v0.7.0 + [a93c6f00] DataFrames v0.22.1 + [1313f7d8] DataFramesMeta v0.6.0 + [5789e2e9] FileIO v1.4.4 + [da1fdf0e] FreqTables v0.4.2 + [7073ff75] IJulia v1.23.0 + [babc3d20] JDF v0.2.20 + [9da8a3cd] JLSO v2.4.0 + [b9914132] JSONTables v1.0.0 + [86f7a689] NamedArrays v0.9.4 + [b98c9c47] Pipe v1.3.0 + [2dfb63ee] PooledArrays v0.5.3 + [f3b207a7] StatsPlots v0.14.17 + [bd369af6] Tables v1.2.1 + [a5390f91] ZipFile v0.9.3 + [9a3f8284] Random + [10745b16] Statistics +``` + +I will try to keep the material up to date as the packages evolve. + +This tutorial covers +[DataFrames](https://github.com/JuliaData/DataFrames.jl) +and [CategoricalArrays](https://github.com/JuliaData/CategoricalArrays.jl), +as they constitute the core of [DataFrames](https://github.com/JuliaData/DataFrames.jl) +along with selected file reading and writing packages. + +In the last [extras](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/13_extras.ipynb) +part mentions *selected* functionalities of *selected* useful packages that I find useful for data manipulation, currently those are: +[FreqTables](https://github.com/nalimilan/FreqTables.jl), +[DataFramesMeta](https://github.com/JuliaStats/DataFramesMeta.jl) (pending its update to support DataFrames.jl 0.22 release), +[StatsPlots](https://github.com/JuliaPlots/StatsPlots.jl). + +# Setting up Jupyter Notebook for work with DataFrames.jl + +By default Jupyter Notebook will limit the number of rows and columns when +displaying a data frame to roughly fit the screen size (like in the REPL). + +You can override this behavior by setting `ENV["COLUMNS"]` or `ENV["LINES"]` +variables to hold the maximum width and height of output in characters +respectively when running a notebook. Alternatively you can add the following +entry `"COLUMNS": "1000", "LINES": "100"` to `"env"` variable in your Jupyter +kernel file. See +[here](https://jupyter-client.readthedocs.io/en/stable/kernels.html) for +information about location and specification of Jupyter kernels. + +# TOC + +| File | Topic | +|-------------------------------------------------------------------------------------------------------------------|-----------------------------------| +| [01_constructors.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/01_constructors.ipynb) | Creating DataFrame and conversion | +| [02_basicinfo.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/02_basicinfo.ipynb) | Getting summary information | +| [03_missingvalues.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/03_missingvalues.ipynb) | Handling missing values | +| [04_loadsave.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/04_loadsave.ipynb) | Loading and saving DataFrames | +| [05_columns.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/05_columns.ipynb) | Working with columns of DataFrame | +| [06_rows.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/06_rows.ipynb) | Working with row of DataFrame | +| [07_factors.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/07_factors.ipynb) | Working with categorical data | +| [08_joins.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/08_joins.ipynb) | Joining DataFrames | +| [09_reshaping.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/09_reshaping.ipynb) | Reshaping DataFrames | +| [10_transforms.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/10_transforms.ipynb) | Transforming DataFrames | +| [11_performance.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/11_performance.ipynb) | Performance tips | +| [12_pitfalls.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/12_pitfalls.ipynb) | Possible pitfalls | +| [13_extras.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/13_extras.ipynb) | Additional interesting packages | + +Changelog: + +| Date | Changes | +| ---------- | ------------------------------------------------------------ | +| 2017-12-05 | Initial release | +| 2017-12-06 | Added description of `insert!`, `merge!`, `empty!`, `categorical!`, `delete!`, `DataFrames.index` | +| 2017-12-09 | Added performance tips | +| 2017-12-10 | Added pitfalls | +| 2017-12-18 | Added additional worthwhile packages: *FreqTables* and *DataFramesMeta* | +| 2017-12-29 | Added description of `filter` and `filter!` | +| 2017-12-31 | Added description of conversion to `Matrix` | +| 2018-04-06 | Added example of extracting a row from a `DataFrame` | +| 2018-04-21 | Major update of whole tutorial | +| 2018-05-01 | Added `byrow!` example | +| 2018-05-13 | Added `StatPlots` package to extras | +| 2018-05-23 | Improved comments in sections 1 do 5 by [Jane Herriman](https://github.com/xorJane) | +| 2018-07-25 | Update to 0.11.7 release | +| 2018-08-25 | Update to Julia 1.0 release: sections 1 to 10 | +| 2018-08-29 | Update to Julia 1.0 release: sections 11, 12 and 13 | +| 2018-09-05 | Update to Julia 1.0 release: FreqTables section | +| 2018-09-10 | Added CSVFiles section to chapter on load/save | +| 2018-09-26 | Updated to DataFrames 0.14.0 | +| 2018-10-04 | Updated to DataFrames 0.14.1, added `haskey` and `repeat` | +| 2018-12-08 | Updated to DataFrames 0.15.2 | +| 2019-01-03 | Updated to DataFrames 0.16.0, added serialization instructions | +| 2019-01-18 | Updated to DataFrames 0.17.0, added `passmissing` | +| 2019-01-27 | Added Feather.jl file read/write | +| 2019-01-30 | Renamed StatPlots.jl to StatsPlots.jl and added Tables.jl| +| 2019-02-08 | Added `groupvars` and `groupindices` functions| +| 2019-04-27 | Updated to DataFrames 0.18.0, dropped JLD2.jl | +| 2019-04-30 | Updated handling of missing values description | +| 2019-07-16 | Updated to DataFrames 0.19.0 | +| 2019-08-14 | Added JSONTables.jl and `Tables.columnindex` | +| 2019-08-16 | Added Project.toml and Manifest.toml | +| 2019-08-26 | Update to Julia 1.2 and DataFrames 0.19.3 | +| 2019-08-29 | Add example how to compress/decompress CSV file using CodecZlib | +| 2019-08-30 | Add examples of JLSO.jl and ZipFile.jl by [xiaodaigh](https://github.com/xiaodaigh) | +| 2019-11-03 | Add examples of JDF.jl by [xiaodaigh](https://github.com/xiaodaigh) | +| 2019-12-08 | Updated to DataFrames 0.20.0 | +| 2020-05-06 | Updated to DataFrames 0.21.0 (except load/save and extras) | +| 2020-11-20 | Updated to DataFrames 0.22.0 (except DataFramesMeta.jl which does not work yet) | +| 2020-11-26 | Updated to DataFramesMeta.jl 0.6; update by @pdeffebach | + +# Core functions summary + +1. Constructors: `DataFrame`, `DataFrame!`, `Tables.rowtable`, `Tables.columntable`, `Matrix`, `eachcol`, `eachrow`, `Tables.namedtupleiterator`, `empty`, `empty!` +2. Getting summary: `size`, `nrow`, `ncol`, `describe`, `names`, `eltypes`, `first`, `last`, `getindex`, `setindex!`, `@view`, `isapprox` +3. Handling missing: `missing` (singleton instance of `Missing`), `ismissing`, `nonmissingtype`, `skipmissing`, `replace`, `replace!`, `coalesce`, `allowmissing`, `disallowmissing`, `allowmissing!`, `completecases`, `dropmissing`, `dropmissing!`, `disallowmissing`, `disallowmissing!`, `passmissing` +4. Loading and saving: `CSV` (package), `CSVFiles` (package), `Serialization` (module), `CSV.read`, `CSV.write`, `save`, `load`, `serialize`, `deserialize`, `Arrow.write`, `Arrow.Table` (from Arrow.jl package), `JSONTables` (package), `arraytable`, `objecttable`, `jsontable`, `CodecZlib` (module), `GzipCompressorStream`, `GzipDecompressorStream`, `JDF.jl` (package), `JDF.savejdf`, `JDF.loadjdf`, `JLSO.jl` (package), `JLSO.save`, `JLSO.load`, `ZipFile.jl` (package), `ZipFile.reader`, `ZipFile.writer`, `ZipFile.addfile` +5. Working with columns: `rename`, `rename!`, `hcat`, `insertcols!`, `categorical!`, `columnindex`, `hasproperty`, `select`, `select!`, `transform`, `transform!`, `combine`, `Not`, `All`, `Between`, `ByRow`, `AsTable` +6. Working with rows: `sort!`, `sort`, `issorted`, `append!`, `vcat`, `push!`, `view`, `filter`, `filter!`, `delete!`, `unique`, `nonunique`, `unique!`, `repeat`, `parent`, `parentindices`, `flatten`, `@pipe` (from `Pipe` package), `only` +7. Working with categorical: `categorical`, `cut`, `isordered`, `ordered!`, `levels`, `unique`, `levels!`, `droplevels!`, `get`, `recode`, `recode!` +8. Joining: `innerjoin`, `leftjoin`, `rightjoin`, `outerjoin`, `semijoin`, `antijoin`, `crossjoin` +9. Reshaping: `stack`, `unstack` +10. Transforming: `groupby`, `mapcols`, `parent`, `groupcols`, `valuecols`, `groupindices`, `keys` (for `GroupedDataFrame`), `combine`, `select`, `select!`, `transform`, `transform!`, `@pipe` (from `Pipe` package) +11. Extras: + * [FreqTables](https://github.com/nalimilan/FreqTables.jl): `freqtable`, `prop`, `Name` + * [DataFramesMeta](https://github.com/JuliaStats/DataFramesMeta.jl): `@with`, `@where`, `@select`, `@transform`, `@orderby`, `@linq`, `@by`, `@combine`, `@eachrow`, `@newcol`, `^`, `cols` + * [StatsPlots](https://github.com/JuliaPlots/StatsPlots.jl): `@df`, `plot`, `density`, `histogram`,`boxplot`, `violin` From 6eeeb8b77675b5c36c447f3632ed94b7532bbb14 Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Sun, 18 Apr 2021 08:31:00 -0300 Subject: [PATCH 04/20] portuguese translation of README.md --- literate_notebooks/src-PT-BR/README.md | 126 ++++++++++++------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/literate_notebooks/src-PT-BR/README.md b/literate_notebooks/src-PT-BR/README.md index 4733e5c..1b9c7bf 100644 --- a/literate_notebooks/src-PT-BR/README.md +++ b/literate_notebooks/src-PT-BR/README.md @@ -1,21 +1,20 @@ -# An Introduction to DataFrames +# Uma introdução de DataFrames -[Bogumił Kamiński](http://bogumilkaminski.pl/about/), November 2020, 2020 +[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Novembro 2020. Tradução de [Jose Storopoli](https://storopoli.io). -**The tutorial is for DataFrames 0.22.1** +**Esse tutorial é para DataFrames 0.22.1** -A brief introduction to basic usage of [DataFrames](https://github.com/JuliaData/DataFrames.jl). +Uma breve introdução sobre o uso básico de [DataFrames](https://github.com/JuliaData/DataFrames.jl). -The tutorial contains a specification of the project environment version under -which it should be run. In order to prepare this environment, before using the -tutorial notebooks, while in the project folder run the following command in the -command line: +Esse tutorial contém uma especificação do ambiente do projeto no qual +deve ser executado. Para preparar esse ambiente, antes de usar os *notebooks* do tutorial, +execute o seguinte comando no diretório raiz do projeto: ``` julia -e 'using Pkg; Pkg.activate("."); Pkg.instantiate()' ``` -Tested under Julia 1.5.3. The project dependencies are the following: +Testado em Julia 1.6.0. As dependências do projeto são: ``` [69666777] Arrow v1.0.1 @@ -41,52 +40,53 @@ Tested under Julia 1.5.3. The project dependencies are the following: [10745b16] Statistics ``` -I will try to keep the material up to date as the packages evolve. +Tentarei manter o material atualizado conforme os pacotes evoluem com novas versões. -This tutorial covers +Este tutorial cobre [DataFrames](https://github.com/JuliaData/DataFrames.jl) -and [CategoricalArrays](https://github.com/JuliaData/CategoricalArrays.jl), -as they constitute the core of [DataFrames](https://github.com/JuliaData/DataFrames.jl) -along with selected file reading and writing packages. +e [CategoricalArrays](https://github.com/JuliaData/CategoricalArrays.jl), +pois constituem o núcleo de [DataFrames](https://github.com/JuliaData/DataFrames.jl) +junto com pacotes selecionados de leitura e gravação de arquivos. -In the last [extras](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/13_extras.ipynb) -part mentions *selected* functionalities of *selected* useful packages that I find useful for data manipulation, currently those are: +No conteúdo [extras](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/13_extras.ipynb) +se menciona *funcionalidades* selecionadas de pacotes *selecionados* que considero úteis para manipulação de dados, atualmente são: [FreqTables](https://github.com/nalimilan/FreqTables.jl), -[DataFramesMeta](https://github.com/JuliaStats/DataFramesMeta.jl) (pending its update to support DataFrames.jl 0.22 release), -[StatsPlots](https://github.com/JuliaPlots/StatsPlots.jl). - -# Setting up Jupyter Notebook for work with DataFrames.jl - -By default Jupyter Notebook will limit the number of rows and columns when -displaying a data frame to roughly fit the screen size (like in the REPL). - -You can override this behavior by setting `ENV["COLUMNS"]` or `ENV["LINES"]` -variables to hold the maximum width and height of output in characters -respectively when running a notebook. Alternatively you can add the following -entry `"COLUMNS": "1000", "LINES": "100"` to `"env"` variable in your Jupyter -kernel file. See -[here](https://jupyter-client.readthedocs.io/en/stable/kernels.html) for -information about location and specification of Jupyter kernels. - -# TOC - -| File | Topic | -|-------------------------------------------------------------------------------------------------------------------|-----------------------------------| -| [01_constructors.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/01_constructors.ipynb) | Creating DataFrame and conversion | -| [02_basicinfo.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/02_basicinfo.ipynb) | Getting summary information | -| [03_missingvalues.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/03_missingvalues.ipynb) | Handling missing values | -| [04_loadsave.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/04_loadsave.ipynb) | Loading and saving DataFrames | -| [05_columns.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/05_columns.ipynb) | Working with columns of DataFrame | -| [06_rows.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/06_rows.ipynb) | Working with row of DataFrame | -| [07_factors.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/07_factors.ipynb) | Working with categorical data | -| [08_joins.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/08_joins.ipynb) | Joining DataFrames | -| [09_reshaping.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/09_reshaping.ipynb) | Reshaping DataFrames | -| [10_transforms.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/10_transforms.ipynb) | Transforming DataFrames | -| [11_performance.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/11_performance.ipynb) | Performance tips | -| [12_pitfalls.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/12_pitfalls.ipynb) | Possible pitfalls | -| [13_extras.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/13_extras.ipynb) | Additional interesting packages | - -Changelog: +[DataFramesMeta](https://github.com/JuliaStats/DataFramesMeta.jl) (aguardando uma atualização para oferecer suporte à versão DataFrames.jl 0.22), +e [StatsPlots](https://github.com/JuliaPlots/StatsPlots.jl). + +# Configurando Jupyter Notebook para trabalhar com DataFrames.jl + +Por padrão, o Jupyter Notebook limitará o número de linhas e colunas quando +exibindo um *data frame* para caber aproximadamente no tamanho da tela (similar ao REPL). + +Você pode substituir este comportamento definindo as variáveis `ENV["COLUMNS"]` ou +`ENV["LINES"]` para manter a largura e altura máximas de saída em caracteres +respectivamente ao executar um notebook. Alternativamente, você pode adicionar a seguinte +entrada `"COLUMNS": "1000", "LINES": "100"` para variável `"env"` em seu +arquivo de kernel Jupyter. Veja +[aqui](https://jupyter-client.readthedocs.io/en/stable/kernels.html) para +informações sobre como localizar e especificar kernels Jupyter. + + +# Índice + +| Arquivo | Tema | +|-------------------------------------------------------------------------------------------------------------------|----------------------------------------------| +| [01_constructors.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/01_constructors.ipynb) | Criando `DataFrame` e conversões | +| [02_basicinfo.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/02_basicinfo.ipynb) | Obtendo informações resumidas | +| [03_missingvalues.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/03_missingvalues.ipynb) | Lidando com valores faltantes `missing` | +| [04_loadsave.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/04_loadsave.ipynb) | Carregando e salvando `DataFrames` | +| [05_columns.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/05_columns.ipynb) | Manipulando colunas de `DataFrame` | +| [06_rows.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/06_rows.ipynb) | Manipulando linhas de `DataFrame` | +| [07_factors.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/07_factors.ipynb) | Manipulando dados categóricos (qualitativos) | +| [08_joins.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/08_joins.ipynb) | Juntando (*join*) `DataFrames` | +| [09_reshaping.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/09_reshaping.ipynb) | Redimensionamento `DataFrames` | +| [10_transforms.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/10_transforms.ipynb) | Transformando `DataFrames` | +| [11_performance.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/11_performance.ipynb) | Dicas de desempenho | +| [12_pitfalls.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/12_pitfalls.ipynb) | Possíveis armadilhas | +| [13_extras.ipynb](https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/13_extras.ipynb) | Pacotes adicionais interessantes | + +*Changelog*: | Date | Changes | | ---------- | ------------------------------------------------------------ | @@ -129,18 +129,18 @@ Changelog: | 2020-11-20 | Updated to DataFrames 0.22.0 (except DataFramesMeta.jl which does not work yet) | | 2020-11-26 | Updated to DataFramesMeta.jl 0.6; update by @pdeffebach | -# Core functions summary - -1. Constructors: `DataFrame`, `DataFrame!`, `Tables.rowtable`, `Tables.columntable`, `Matrix`, `eachcol`, `eachrow`, `Tables.namedtupleiterator`, `empty`, `empty!` -2. Getting summary: `size`, `nrow`, `ncol`, `describe`, `names`, `eltypes`, `first`, `last`, `getindex`, `setindex!`, `@view`, `isapprox` -3. Handling missing: `missing` (singleton instance of `Missing`), `ismissing`, `nonmissingtype`, `skipmissing`, `replace`, `replace!`, `coalesce`, `allowmissing`, `disallowmissing`, `allowmissing!`, `completecases`, `dropmissing`, `dropmissing!`, `disallowmissing`, `disallowmissing!`, `passmissing` -4. Loading and saving: `CSV` (package), `CSVFiles` (package), `Serialization` (module), `CSV.read`, `CSV.write`, `save`, `load`, `serialize`, `deserialize`, `Arrow.write`, `Arrow.Table` (from Arrow.jl package), `JSONTables` (package), `arraytable`, `objecttable`, `jsontable`, `CodecZlib` (module), `GzipCompressorStream`, `GzipDecompressorStream`, `JDF.jl` (package), `JDF.savejdf`, `JDF.loadjdf`, `JLSO.jl` (package), `JLSO.save`, `JLSO.load`, `ZipFile.jl` (package), `ZipFile.reader`, `ZipFile.writer`, `ZipFile.addfile` -5. Working with columns: `rename`, `rename!`, `hcat`, `insertcols!`, `categorical!`, `columnindex`, `hasproperty`, `select`, `select!`, `transform`, `transform!`, `combine`, `Not`, `All`, `Between`, `ByRow`, `AsTable` -6. Working with rows: `sort!`, `sort`, `issorted`, `append!`, `vcat`, `push!`, `view`, `filter`, `filter!`, `delete!`, `unique`, `nonunique`, `unique!`, `repeat`, `parent`, `parentindices`, `flatten`, `@pipe` (from `Pipe` package), `only` -7. Working with categorical: `categorical`, `cut`, `isordered`, `ordered!`, `levels`, `unique`, `levels!`, `droplevels!`, `get`, `recode`, `recode!` -8. Joining: `innerjoin`, `leftjoin`, `rightjoin`, `outerjoin`, `semijoin`, `antijoin`, `crossjoin` -9. Reshaping: `stack`, `unstack` -10. Transforming: `groupby`, `mapcols`, `parent`, `groupcols`, `valuecols`, `groupindices`, `keys` (for `GroupedDataFrame`), `combine`, `select`, `select!`, `transform`, `transform!`, `@pipe` (from `Pipe` package) +# Sumário das funções-chave + +1. Construtores: `DataFrame`, `DataFrame!`, `Tables.rowtable`, `Tables.columntable`, `Matrix`, `eachcol`, `eachrow`, `Tables.namedtupleiterator`, `empty`, `empty!` +2. Obtendo resumos: `size`, `nrow`, `ncol`, `describe`, `names`, `eltypes`, `first`, `last`, `getindex`, `setindex!`, `@view`, `isapprox` +3. Lidando com dados faltantes: `missing` (singleton instance of `Missing`), `ismissing`, `nonmissingtype`, `skipmissing`, `replace`, `replace!`, `coalesce`, `allowmissing`, `disallowmissing`, `allowmissing!`, `completecases`, `dropmissing`, `dropmissing!`, `disallowmissing`, `disallowmissing!`, `passmissing` +4. Carregando e salvando: `CSV` (package), `CSVFiles` (package), `Serialization` (module), `CSV.read`, `CSV.write`, `save`, `load`, `serialize`, `deserialize`, `Arrow.write`, `Arrow.Table` (from Arrow.jl package), `JSONTables` (package), `arraytable`, `objecttable`, `jsontable`, `CodecZlib` (module), `GzipCompressorStream`, `GzipDecompressorStream`, `JDF.jl` (package), `JDF.savejdf`, `JDF.loadjdf`, `JLSO.jl` (package), `JLSO.save`, `JLSO.load`, `ZipFile.jl` (package), `ZipFile.reader`, `ZipFile.writer`, `ZipFile.addfile` +5. Manipulando colunas: `rename`, `rename!`, `hcat`, `insertcols!`, `categorical!`, `columnindex`, `hasproperty`, `select`, `select!`, `transform`, `transform!`, `combine`, `Not`, `All`, `Between`, `ByRow`, `AsTable` +6. Manipulando linhas: `sort!`, `sort`, `issorted`, `append!`, `vcat`, `push!`, `view`, `filter`, `filter!`, `delete!`, `unique`, `nonunique`, `unique!`, `repeat`, `parent`, `parentindices`, `flatten`, `@pipe` (from `Pipe` package), `only` +7. Manipulando dados categóricos: `categorical`, `cut`, `isordered`, `ordered!`, `levels`, `unique`, `levels!`, `droplevels!`, `get`, `recode`, `recode!` +8. Juntando: `innerjoin`, `leftjoin`, `rightjoin`, `outerjoin`, `semijoin`, `antijoin`, `crossjoin` +9. Redimensionamento: `stack`, `unstack` +10. Transformando: `groupby`, `mapcols`, `parent`, `groupcols`, `valuecols`, `groupindices`, `keys` (for `GroupedDataFrame`), `combine`, `select`, `select!`, `transform`, `transform!`, `@pipe` (from `Pipe` package) 11. Extras: * [FreqTables](https://github.com/nalimilan/FreqTables.jl): `freqtable`, `prop`, `Name` * [DataFramesMeta](https://github.com/JuliaStats/DataFramesMeta.jl): `@with`, `@where`, `@select`, `@transform`, `@orderby`, `@linq`, `@by`, `@combine`, `@eachrow`, `@newcol`, `^`, `cols` From 41420ffbc9217f8d0c1da5cf16f8cdcc5a161175 Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Sun, 18 Apr 2021 09:51:25 -0300 Subject: [PATCH 05/20] added DataFrames.jl comparisons in README.md --- literate_notebooks/src-PT-BR/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/literate_notebooks/src-PT-BR/README.md b/literate_notebooks/src-PT-BR/README.md index 1b9c7bf..d0ccee0 100644 --- a/literate_notebooks/src-PT-BR/README.md +++ b/literate_notebooks/src-PT-BR/README.md @@ -54,6 +54,12 @@ se menciona *funcionalidades* selecionadas de pacotes *selecionados* que conside [DataFramesMeta](https://github.com/JuliaStats/DataFramesMeta.jl) (aguardando uma atualização para oferecer suporte à versão DataFrames.jl 0.22), e [StatsPlots](https://github.com/JuliaPlots/StatsPlots.jl). +Muitos devem ter tido contato com dados tabulares em outras linguagens, notoriamente Python com `pandas` +ou R com `dplyr`. Para facilitar a adoção de Julia e DataFrames.jl, a documentação do pacote +DataFrames.jl possui [uma seção com comparações das principais funcionalidades e operações do +DataFrames.jl em relação à `pandas`, `dplyr` e +Stata](https://dataframes.juliadata.org/latest/man/comparisons/#Comparisons). + # Configurando Jupyter Notebook para trabalhar com DataFrames.jl Por padrão, o Jupyter Notebook limitará o número de linhas e colunas quando @@ -128,6 +134,7 @@ informações sobre como localizar e especificar kernels Jupyter. | 2020-05-06 | Updated to DataFrames 0.21.0 (except load/save and extras) | | 2020-11-20 | Updated to DataFrames 0.22.0 (except DataFramesMeta.jl which does not work yet) | | 2020-11-26 | Updated to DataFramesMeta.jl 0.6; update by @pdeffebach | +| 2021-04-18 | First Portuguese translation by @storopoli | # Sumário das funções-chave From 199b9ae8a92a21654090bcb906f34e2964c3ebc0 Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Sun, 18 Apr 2021 09:55:48 -0300 Subject: [PATCH 06/20] added .toml files to src/ and src-PT-BR/ --- literate_notebooks/src-PT-BR/Manifest.toml | 1227 ++++++++++++++++++++ literate_notebooks/src-PT-BR/Project.toml | 22 + literate_notebooks/src/Manifest.toml | 1227 ++++++++++++++++++++ literate_notebooks/src/Project.toml | 22 + 4 files changed, 2498 insertions(+) create mode 100644 literate_notebooks/src-PT-BR/Manifest.toml create mode 100644 literate_notebooks/src-PT-BR/Project.toml create mode 100644 literate_notebooks/src/Manifest.toml create mode 100644 literate_notebooks/src/Project.toml diff --git a/literate_notebooks/src-PT-BR/Manifest.toml b/literate_notebooks/src-PT-BR/Manifest.toml new file mode 100644 index 0000000..03693db --- /dev/null +++ b/literate_notebooks/src-PT-BR/Manifest.toml @@ -0,0 +1,1227 @@ +# This file is machine-generated - editing it directly is not advised + +[[AbstractFFTs]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "051c95d6836228d120f5f4b984dd5aba1624f716" +uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" +version = "0.5.0" + +[[Adapt]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "42c42f2221906892ceb765dbcb1a51deeffd86d7" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "2.3.0" + +[[Arpack]] +deps = ["Arpack_jll", "Libdl", "LinearAlgebra"] +git-tree-sha1 = "2ff92b71ba1747c5fdd541f8fc87736d82f40ec9" +uuid = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97" +version = "0.4.0" + +[[Arpack_jll]] +deps = ["Libdl", "OpenBLAS_jll", "Pkg"] +git-tree-sha1 = "e214a9b9bd1b4e1b4f15b22c0994862b66af7ff7" +uuid = "68821587-b530-5797-8361-c406ea357684" +version = "3.5.0+3" + +[[Arrow]] +deps = ["CodecLz4", "CodecZstd", "DataAPI", "Dates", "Mmap", "PooledArrays", "SentinelArrays", "Tables", "TimeZones"] +git-tree-sha1 = "e2196f539c141a98d66dc50145b67325b7842b1f" +uuid = "69666777-d1a9-59fb-9406-91d4454c9d45" +version = "1.0.1" + +[[Artifacts]] +deps = ["Pkg"] +git-tree-sha1 = "c30985d8821e0cd73870b17b0ed0ce6dc44cb744" +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +version = "1.3.0" + +[[AxisAlgorithms]] +deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"] +git-tree-sha1 = "a4d07a1c313392a77042855df46c5f534076fab9" +uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950" +version = "1.0.0" + +[[BSON]] +git-tree-sha1 = "dd36d7cf3d185eeaaf64db902c15174b22f5dafb" +uuid = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" +version = "0.2.6" + +[[Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[BenchmarkTools]] +deps = ["JSON", "Logging", "Printf", "Statistics", "UUIDs"] +git-tree-sha1 = "9e62e66db34540a0c919d72172cc2f642ac71260" +uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +version = "0.5.0" + +[[Blosc]] +deps = ["Blosc_jll"] +git-tree-sha1 = "84cf7d0f8fd46ca6f1b3e0305b4b4a37afe50fd6" +uuid = "a74b3585-a348-5f62-a45c-50e91977d574" +version = "0.7.0" + +[[Blosc_jll]] +deps = ["Libdl", "Lz4_jll", "Pkg", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "aa9ef39b54a168c3df1b2911e7797e4feee50fbe" +uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9" +version = "1.14.3+1" + +[[BufferedStreams]] +deps = ["Compat", "Test"] +git-tree-sha1 = "5d55b9486590fdda5905c275bb21ce1f0754020f" +uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d" +version = "1.0.0" + +[[Bzip2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "c3598e525718abcc440f69cc6d5f60dda0a1b61e" +uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" +version = "1.0.6+5" + +[[CSV]] +deps = ["Dates", "Mmap", "Parsers", "PooledArrays", "SentinelArrays", "Tables", "Unicode"] +git-tree-sha1 = "290a56b2448024a1501834ee8b7d5d7004bc5ad3" +uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +version = "0.8.2" + +[[Cairo_jll]] +deps = ["Artifacts", "Bzip2_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "e2f47f6d8337369411569fd45ae5753ca10394c6" +uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a" +version = "1.16.0+6" + +[[CategoricalArrays]] +deps = ["DataAPI", "Future", "JSON", "Missings", "Printf", "Statistics", "StructTypes", "Unicode"] +git-tree-sha1 = "5861101791fa76fafe8dddefd70ffbfe4e33ecae" +uuid = "324d7699-5711-5eae-9e2f-1d82baa6b597" +version = "0.9.0" + +[[Clustering]] +deps = ["Distances", "LinearAlgebra", "NearestNeighbors", "Printf", "SparseArrays", "Statistics", "StatsBase"] +git-tree-sha1 = "75479b7df4167267d75294d14b58244695beb2ac" +uuid = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5" +version = "0.14.2" + +[[CodecLz4]] +deps = ["Lz4_jll", "TranscodingStreams"] +git-tree-sha1 = "59fe0cb37784288d6b9f1baebddbf75457395d40" +uuid = "5ba52731-8f18-5e0d-9241-30f10d1ec561" +version = "0.4.0" + +[[CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.0" + +[[CodecZstd]] +deps = ["TranscodingStreams", "Zstd_jll"] +git-tree-sha1 = "d19cd9ae79ef31774151637492291d75194fc5fa" +uuid = "6b39b394-51ab-5f42-8807-6242bab2b4c2" +version = "0.7.0" + +[[ColorSchemes]] +deps = ["ColorTypes", "Colors", "FixedPointNumbers", "Random", "StaticArrays"] +git-tree-sha1 = "5d472aa8908568bc198564db06983913a6c2c8e7" +uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4" +version = "3.10.1" + +[[ColorTypes]] +deps = ["FixedPointNumbers", "Random"] +git-tree-sha1 = "4bffea7ed1a9f0f3d1a131bbcd4b925548d75288" +uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" +version = "0.10.9" + +[[Colors]] +deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Reexport"] +git-tree-sha1 = "008d6bc68dea6beb6303fdc37188cb557391ebf2" +uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" +version = "0.12.4" + +[[Combinatorics]] +git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" +uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" +version = "1.0.2" + +[[Compat]] +deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] +git-tree-sha1 = "a706ff10f1cd8dab94f59fd09c0e657db8e77ff0" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "3.23.0" + +[[CompilerSupportLibraries_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "8e695f735fca77e9708e795eda62afdb869cbb70" +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "0.3.4+0" + +[[Conda]] +deps = ["JSON", "VersionParsing"] +git-tree-sha1 = "c0647249d785f1d5139c0cc96db8f6b32f7ec416" +uuid = "8f4d0f93-b110-5947-807f-2305c1781a2d" +version = "1.5.0" + +[[Contour]] +deps = ["StaticArrays"] +git-tree-sha1 = "0d128f9c2d9560349dc46f60c42036e244271d72" +uuid = "d38c429a-6771-53c6-b99e-75d170b6e991" +version = "0.5.6" + +[[Crayons]] +git-tree-sha1 = "3f71217b538d7aaee0b69ab47d9b7724ca8afa0d" +uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" +version = "4.0.4" + +[[DataAPI]] +git-tree-sha1 = "ad84f52c0b8f05aa20839484dbaf01690b41ff84" +uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" +version = "1.4.0" + +[[DataFrames]] +deps = ["CategoricalArrays", "Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "20159837c2e5e196793a313cd700b8199fd8f985" +uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +version = "0.22.1" + +[[DataFramesMeta]] +deps = ["DataFrames", "Reexport"] +git-tree-sha1 = "d2b8f08f3b84ba53321d5609a622ad9f61998a6a" +uuid = "1313f7d8-7da2-5740-9ea0-a2ca25f37964" +version = "0.6.0" + +[[DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "fb0aa371da91c1ff9dc7fbed6122d3e411420b9c" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.8" + +[[DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" + +[[DataValues]] +deps = ["DataValueInterfaces", "Dates"] +git-tree-sha1 = "d88a19299eba280a6d062e135a43f00323ae70bf" +uuid = "e7dc6d0d-1eca-5fa6-8ad6-5aecde8b7ea5" +version = "0.4.13" + +[[Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[DelimitedFiles]] +deps = ["Mmap"] +uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" + +[[Distances]] +deps = ["LinearAlgebra", "Statistics"] +git-tree-sha1 = "e8b13ba5f166e11df2de6fc283e5db7864245df0" +uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" +version = "0.10.0" + +[[Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[Distributions]] +deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "StaticArrays", "Statistics", "StatsBase", "StatsFuns"] +git-tree-sha1 = "6493eec6bfb1e578cff879b66844807e3625c83c" +uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" +version = "0.24.4" + +[[DocStringExtensions]] +deps = ["LibGit2", "Markdown", "Pkg", "Test"] +git-tree-sha1 = "50ddf44c53698f5e784bbebb3f4b21c5807401b1" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.8.3" + +[[EarCut_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "92d8f9f208637e8d2d28c664051a00569c01493d" +uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5" +version = "2.1.5+1" + +[[Expat_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "1402e52fcda25064f51c77a9655ce8680b76acf0" +uuid = "2e619515-83b5-522b-bb60-26c02a35a201" +version = "2.2.7+6" + +[[ExprTools]] +git-tree-sha1 = "10407a39b87f29d47ebaca8edbc75d7c302ff93e" +uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" +version = "0.1.3" + +[[EzXML]] +deps = ["Printf", "XML2_jll"] +git-tree-sha1 = "0fa3b52a04a4e210aeb1626def9c90df3ae65268" +uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" +version = "1.1.0" + +[[FFMPEG]] +deps = ["FFMPEG_jll", "x264_jll"] +git-tree-sha1 = "9a73ffdc375be61b0e4516d83d880b265366fe1f" +uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a" +version = "0.4.0" + +[[FFMPEG_jll]] +deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "LibVPX_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "Pkg", "Zlib_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] +git-tree-sha1 = "3cc57ad0a213808473eafef4845a74766242e05f" +uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" +version = "4.3.1+4" + +[[FFTW]] +deps = ["AbstractFFTs", "FFTW_jll", "IntelOpenMP_jll", "Libdl", "LinearAlgebra", "MKL_jll", "Reexport"] +git-tree-sha1 = "8b7c16b56936047ca41bf25effa137ae0b381ae8" +uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" +version = "1.2.4" + +[[FFTW_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f10c3009373a2d5c4349b8a2932d8accb892892d" +uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a" +version = "3.3.9+6" + +[[FileIO]] +deps = ["Pkg"] +git-tree-sha1 = "cad2e71389ecb2f4480e0de74faab04af13d7929" +uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" +version = "1.4.4" + +[[FilePathsBase]] +deps = ["Dates", "Mmap", "Printf", "Test", "UUIDs"] +git-tree-sha1 = "eea043eb9e9087e53815e9587e9106027c3c6b14" +uuid = "48062228-2e41-5def-b9a4-89aafe57970f" +version = "0.9.5" + +[[FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[FillArrays]] +deps = ["LinearAlgebra", "Random", "SparseArrays"] +git-tree-sha1 = "c1cf9e87a5c45f0c05dc31ae95757f706e70865a" +uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" +version = "0.10.1" + +[[FixedPointNumbers]] +deps = ["Statistics"] +git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" +uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" +version = "0.8.4" + +[[Fontconfig_jll]] +deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "35895cf184ceaab11fd778b4590144034a167a2f" +uuid = "a3f928ae-7b40-5064-980b-68af3947d34b" +version = "2.13.1+14" + +[[Formatting]] +deps = ["Printf"] +git-tree-sha1 = "a0c901c29c0e7c763342751c0a94211d56c0de5c" +uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" +version = "0.4.1" + +[[FreeType2_jll]] +deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "cbd58c9deb1d304f5a245a0b7eb841a2560cfec6" +uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" +version = "2.10.1+5" + +[[FreqTables]] +deps = ["CategoricalArrays", "Missings", "NamedArrays", "Tables"] +git-tree-sha1 = "3adc3eefa0cd2042f2513240f95b36c8ddd0495d" +uuid = "da1fdf0e-e0ff-5433-a45f-9bb5ff651cb1" +version = "0.4.2" + +[[FriBidi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "0d20aed5b14dd4c9a2453c1b601d08e1149679cc" +uuid = "559328eb-81f9-559d-9380-de523a88c83c" +version = "1.0.5+6" + +[[Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + +[[GLFW_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"] +git-tree-sha1 = "a1bbf700b5388bffc3d882f4f4d625cf1c714fd7" +uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89" +version = "3.3.2+1" + +[[GR]] +deps = ["Base64", "DelimitedFiles", "GR_jll", "HTTP", "JSON", "LinearAlgebra", "Pkg", "Printf", "Random", "Serialization", "Sockets", "Test", "UUIDs"] +git-tree-sha1 = "b90b826782cb3ac5b7a7f41b3fd0113180257ed4" +uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" +version = "0.53.0" + +[[GR_jll]] +deps = ["Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Pkg", "Qhull_jll", "Qt_jll", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "daaccb414719ae63625b9b5e0eb4b1ec5b194590" +uuid = "d2c73de3-f751-5644-a686-071e5b155ba9" +version = "0.52.0+0" + +[[GeometryBasics]] +deps = ["EarCut_jll", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"] +git-tree-sha1 = "876a906eab3be990fdcbfe1e43bb3a76f4776f72" +uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326" +version = "0.3.3" + +[[Gettext_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "8c14294a079216000a0bdca5ec5a447f073ddc9d" +uuid = "78b55507-aeef-58d4-861c-77aaff3498b1" +version = "0.20.1+7" + +[[Glib_jll]] +deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "04690cc5008b38ecbdfede949220bc7d9ba26397" +uuid = "7746bdde-850d-59dc-9ae8-88ece973131d" +version = "2.59.0+4" + +[[Grisu]] +git-tree-sha1 = "03d381f65183cb2d0af8b3425fde97263ce9a995" +uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe" +version = "1.0.0" + +[[HTTP]] +deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"] +git-tree-sha1 = "c7ec02c4c6a039a98a15f955462cd7aea5df4508" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "0.8.19" + +[[IJulia]] +deps = ["Base64", "Conda", "Dates", "InteractiveUtils", "JSON", "Markdown", "MbedTLS", "Pkg", "Printf", "REPL", "Random", "SoftGlobalScope", "Test", "UUIDs", "ZMQ"] +git-tree-sha1 = "68e1792f3ca9a0df3b4e59d03a3aca828726917e" +uuid = "7073ff75-c697-5162-941a-fcdaad2a7d2a" +version = "1.23.0" + +[[IniFile]] +deps = ["Test"] +git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8" +uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" +version = "0.5.0" + +[[IntelOpenMP_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "fb8e1c7a5594ba56f9011310790e03b5384998d6" +uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" +version = "2018.0.3+0" + +[[InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[Interpolations]] +deps = ["AxisAlgorithms", "LinearAlgebra", "OffsetArrays", "Random", "Ratios", "SharedArrays", "SparseArrays", "StaticArrays", "WoodburyMatrices"] +git-tree-sha1 = "d2ff0813f0f110918db2537201686575fcf8d345" +uuid = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" +version = "0.13.0" + +[[InvertedIndices]] +deps = ["Test"] +git-tree-sha1 = "15732c475062348b0165684ffe28e85ea8396afc" +uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" +version = "1.0.0" + +[[IterTools]] +git-tree-sha1 = "05110a2ab1fc5f932622ffea2a003221f4782c18" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.3.0" + +[[IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[JDF]] +deps = ["Blosc", "BufferedStreams", "CategoricalArrays", "DataAPI", "DataFrames", "Missings", "PooledArrays", "Serialization", "StatsBase", "Tables", "TimeZones", "WeakRefStrings"] +git-tree-sha1 = "77fcb0f3f55378587bf33b2560417104415f3b9d" +uuid = "babc3d20-cd49-4f60-a736-a8f9c08892d3" +version = "0.2.20" + +[[JLLWrappers]] +git-tree-sha1 = "c70593677bbf2c3ccab4f7500d0f4dacfff7b75c" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.1.3" + +[[JLSO]] +deps = ["BSON", "CodecZlib", "FilePathsBase", "Memento", "Pkg", "Serialization"] +git-tree-sha1 = "85124b548bf4c2bb59284d353aa09ffc224d761f" +uuid = "9da8a3cd-07a3-59c0-a743-3fdc52c30d11" +version = "2.4.0" + +[[JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.1" + +[[JSON3]] +deps = ["Dates", "Mmap", "Parsers", "StructTypes", "UUIDs"] +git-tree-sha1 = "961ef1c3e5c8a595d5bec270a9007429ef12ed10" +uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +version = "1.5.1" + +[[JSONTables]] +deps = ["JSON3", "StructTypes", "Tables"] +git-tree-sha1 = "15ffb1561865803d7a52ed6714408647c9710af6" +uuid = "b9914132-a727-11e9-1322-f18e41205b0b" +version = "1.0.0" + +[[JpegTurbo_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9aff0587d9603ea0de2c6f6300d9f9492bbefbd3" +uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" +version = "2.0.1+3" + +[[KernelDensity]] +deps = ["Distributions", "DocStringExtensions", "FFTW", "Interpolations", "StatsBase"] +git-tree-sha1 = "09aeec87bdc9c1fa70d0b508dfa94a21acd280d9" +uuid = "5ab0869b-81aa-558d-bb23-cbf5423bbe9b" +version = "0.6.2" + +[[LAME_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "df381151e871f41ee86cee4f5f6fd598b8a68826" +uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d" +version = "3.100.0+3" + +[[LZO_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f128cd6cd05ffd6d3df0523ed99b90ff6f9b349a" +uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" +version = "2.10.0+3" + +[[LaTeXStrings]] +git-tree-sha1 = "c7aebfecb1a60d59c0fe023a68ec947a208b1e6b" +uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" +version = "1.2.0" + +[[Latexify]] +deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"] +git-tree-sha1 = "8771ad2b1464aa6188899ca0c3e432341e35f96a" +uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" +version = "0.14.5" + +[[LibGit2]] +deps = ["Printf"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[LibVPX_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "85fcc80c3052be96619affa2fe2e6d2da3908e11" +uuid = "dd192d2f-8180-539f-9fb4-cc70b1dcf69a" +version = "1.9.0+1" + +[[Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[Libffi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "a2cd088a88c0d37eef7d209fd3d8712febce0d90" +uuid = "e9f186c6-92d2-5b65-8a66-fee21dc1b490" +version = "3.2.1+4" + +[[Libgcrypt_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgpg_error_jll", "Pkg"] +git-tree-sha1 = "b391a18ab1170a2e568f9fb8d83bc7c780cb9999" +uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4" +version = "1.8.5+4" + +[[Libglvnd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll", "Xorg_libXext_jll"] +git-tree-sha1 = "7739f837d6447403596a75d19ed01fd08d6f56bf" +uuid = "7e76a0d4-f3c7-5321-8279-8d96eeed0f29" +version = "1.3.0+3" + +[[Libgpg_error_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "ec7f2e8ad5c9fa99fc773376cdbc86d9a5a23cb7" +uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8" +version = "1.36.0+3" + +[[Libiconv_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "8e924324b2e9275a51407a4e06deb3455b1e359f" +uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" +version = "1.16.0+7" + +[[Libmount_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "51ad0c01c94c1ce48d5cad629425035ad030bfd5" +uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9" +version = "2.34.0+3" + +[[Libtiff_jll]] +deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "291dd857901f94d683973cdf679984cdf73b56d0" +uuid = "89763e89-9b03-5906-acba-b20f662cd828" +version = "4.1.0+2" + +[[Libuuid_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f879ae9edbaa2c74c922e8b85bb83cc84ea1450b" +uuid = "38a345b3-de98-5d2b-a5d3-14cd9215e700" +version = "2.34.0+7" + +[[LinearAlgebra]] +deps = ["Libdl"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[Lz4_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "51b1db0732bbdcfabb60e36095cc3ed9c0016932" +uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" +version = "1.9.2+2" + +[[MKL_jll]] +deps = ["IntelOpenMP_jll", "Libdl", "Pkg"] +git-tree-sha1 = "eb540ede3aabb8284cb482aa41d00d6ca850b1f8" +uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7" +version = "2020.2.254+0" + +[[MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "6a8a2a625ab0dea913aba95c11370589e0239ff0" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.6" + +[[Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[MbedTLS]] +deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"] +git-tree-sha1 = "1c38e51c3d08ef2278062ebceade0e46cefc96fe" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "1.0.3" + +[[MbedTLS_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "0eef589dd1c26a3ac9d753fe1a8bcad63f956fa6" +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.16.8+1" + +[[Measures]] +git-tree-sha1 = "e498ddeee6f9fdb4551ce855a46f54dbd900245f" +uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e" +version = "0.3.1" + +[[Memento]] +deps = ["Dates", "Distributed", "JSON", "Serialization", "Sockets", "Syslogs", "Test", "TimeZones", "UUIDs"] +git-tree-sha1 = "d6dfb54d7e8a9b4a2b1773acf7275a4f607906b2" +uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" +version = "1.1.2" + +[[Missings]] +deps = ["DataAPI"] +git-tree-sha1 = "ed61674a0864832495ffe0a7e889c0da76b0f4c8" +uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" +version = "0.4.4" + +[[Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[Mocking]] +deps = ["ExprTools"] +git-tree-sha1 = "916b850daad0d46b8c71f65f719c49957e9513ed" +uuid = "78c3b35d-d492-501b-9361-3d52fe80e533" +version = "0.7.1" + +[[MultivariateStats]] +deps = ["Arpack", "LinearAlgebra", "SparseArrays", "Statistics", "StatsBase"] +git-tree-sha1 = "352fae519b447bf52e6de627b89f448bcd469e4e" +uuid = "6f286f6a-111f-5878-ab1e-185364afe411" +version = "0.7.0" + +[[NaNMath]] +git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "0.3.5" + +[[NamedArrays]] +deps = ["Combinatorics", "DataStructures", "DelimitedFiles", "InvertedIndices", "LinearAlgebra", "Random", "Requires", "SparseArrays", "Statistics"] +git-tree-sha1 = "7d96d4c09526458d66ff84d7648be7eb7c38a547" +uuid = "86f7a689-2022-50b4-a561-43c23ac3c673" +version = "0.9.4" + +[[NearestNeighbors]] +deps = ["Distances", "StaticArrays"] +git-tree-sha1 = "da77adc83db31176804ce8307e61ef5bedca2e58" +uuid = "b8a86587-4115-5ab1-83bc-aa920d37bbce" +version = "0.4.7" + +[[Observables]] +git-tree-sha1 = "635fe10760447cfa86f5118edf2f47eb864fb495" +uuid = "510215fc-4207-5dde-b226-833fc4488ee2" +version = "0.3.2" + +[[OffsetArrays]] +deps = ["Adapt"] +git-tree-sha1 = "9db93b990af57b3a56dca38476832f60d58f777b" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.4.0" + +[[Ogg_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "a42c0f138b9ebe8b58eba2271c5053773bde52d0" +uuid = "e7412a2a-1a6e-54c0-be00-318e2571c051" +version = "1.3.4+2" + +[[OpenBLAS_jll]] +deps = ["CompilerSupportLibraries_jll", "Libdl", "Pkg"] +git-tree-sha1 = "0c922fd9634e358622e333fc58de61f05a048492" +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.9+5" + +[[OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "71bbbc616a1d710879f5a1021bcba65ffba6ce58" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.1+6" + +[[OpenSpecFun_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9db77584158d0ab52307f8c04f8e7c08ca76b5b3" +uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" +version = "0.5.3+4" + +[[Opus_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f9d57f4126c39565e05a2b0264df99f497fc6f37" +uuid = "91d4177d-7536-5919-b921-800302f37372" +version = "1.3.1+3" + +[[OrderedCollections]] +git-tree-sha1 = "cf59cfed2e2c12e8a2ff0a4f1e9b2cd8650da6db" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.3.2" + +[[PCRE_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "1b556ad51dceefdbf30e86ffa8f528b73c7df2bb" +uuid = "2f80f16e-611a-54ab-bc61-aa92de5b98fc" +version = "8.42.0+4" + +[[PDMats]] +deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse", "Test"] +git-tree-sha1 = "95a4038d1011dfdbde7cecd2ad0ac411e53ab1bc" +uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" +version = "0.10.1" + +[[Parsers]] +deps = ["Dates"] +git-tree-sha1 = "b417be52e8be24e916e34b3d70ec2da7bdf56a68" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "1.0.12" + +[[Pipe]] +git-tree-sha1 = "6842804e7867b115ca9de748a0cf6b364523c16d" +uuid = "b98c9c47-44ae-5843-9183-064241ee97a0" +version = "1.3.0" + +[[Pixman_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "392d85fe2fd2c613442f9694dd566c0d5641d58c" +uuid = "30392449-352a-5448-841d-b1acce4e97dc" +version = "0.38.4+5" + +[[Pkg]] +deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" + +[[PlotThemes]] +deps = ["PlotUtils", "Requires", "Statistics"] +git-tree-sha1 = "c6f5ea535551b3b16835134697f0c65d06c94b91" +uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a" +version = "2.0.0" + +[[PlotUtils]] +deps = ["ColorSchemes", "Colors", "Dates", "Printf", "Random", "Reexport", "Statistics"] +git-tree-sha1 = "4e098f88dad9a2b518b83124a116be1c49e2b2bf" +uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043" +version = "1.0.7" + +[[Plots]] +deps = ["Base64", "Contour", "Dates", "FFMPEG", "FixedPointNumbers", "GR", "GeometryBasics", "JSON", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "PlotThemes", "PlotUtils", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs"] +git-tree-sha1 = "173c7250ccd7c98615b04c669eb13fa7fab494b0" +uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +version = "1.9.1" + +[[PooledArrays]] +deps = ["DataAPI"] +git-tree-sha1 = "b1333d4eced1826e15adbdf01a4ecaccca9d353c" +uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" +version = "0.5.3" + +[[PrettyTables]] +deps = ["Crayons", "Formatting", "Markdown", "Reexport", "Tables"] +git-tree-sha1 = "237170206bf38a66fee4d845f4ae57f63788eeb0" +uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" +version = "0.10.1" + +[[Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[Qhull_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "585989201bf8741e165ae52df54de79c5299daa7" +uuid = "784f63db-0788-585a-bace-daefebcd302b" +version = "2019.1.0+2" + +[[Qt_jll]] +deps = ["Artifacts", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"] +git-tree-sha1 = "72244a8e084251aea25968c61bbf5c001aaa7d5a" +uuid = "ede63266-ebff-546c-83e0-1c6fb6d0efc8" +version = "5.15.1+0" + +[[QuadGK]] +deps = ["DataStructures", "LinearAlgebra"] +git-tree-sha1 = "12fbe86da16df6679be7521dfb39fbc861e1dc7b" +uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" +version = "2.4.1" + +[[REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[Random]] +deps = ["Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[Ratios]] +git-tree-sha1 = "37d210f612d70f3f7d57d488cb3b6eff56ad4e41" +uuid = "c84ed2f1-dad5-54f0-aa8e-dbefe2724439" +version = "0.4.0" + +[[RecipesBase]] +git-tree-sha1 = "b3fb709f3c97bfc6e948be68beeecb55a0b340ae" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.1.1" + +[[RecipesPipeline]] +deps = ["Dates", "NaNMath", "PlotUtils", "RecipesBase"] +git-tree-sha1 = "9ea2f5bf1b26918b16e9f885bb8e05206bfc2144" +uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c" +version = "0.2.1" + +[[Reexport]] +deps = ["Pkg"] +git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0" +uuid = "189a3867-3050-52da-a836-e630ba90ab69" +version = "0.2.0" + +[[Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "e05c53ebc86933601d36212a93b39144a2733493" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.1.1" + +[[Rmath]] +deps = ["Random", "Rmath_jll"] +git-tree-sha1 = "86c5647b565873641538d8f812c04e4c9dbeb370" +uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" +version = "0.6.1" + +[[Rmath_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "d76185aa1f421306dec73c057aa384bad74188f0" +uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" +version = "0.2.2+1" + +[[SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" + +[[Scratch]] +deps = ["Dates"] +git-tree-sha1 = "ad4b278adb62d185bbcb6864dc24959ab0627bf6" +uuid = "6c6a2e73-6563-6170-7368-637461726353" +version = "1.0.3" + +[[SentinelArrays]] +deps = ["Dates", "Random"] +git-tree-sha1 = "6ccde405cf0759eba835eb613130723cb8f10ff9" +uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" +version = "1.2.16" + +[[Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[SharedArrays]] +deps = ["Distributed", "Mmap", "Random", "Serialization"] +uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" + +[[Showoff]] +deps = ["Dates", "Grisu"] +git-tree-sha1 = "ee010d8f103468309b8afac4abb9be2e18ff1182" +uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f" +version = "0.3.2" + +[[Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[SoftGlobalScope]] +deps = ["REPL"] +git-tree-sha1 = "986ec2b6162ccb95de5892ed17832f95badf770c" +uuid = "b85f4697-e234-5449-a836-ec8e2f98b302" +version = "1.1.0" + +[[SortingAlgorithms]] +deps = ["DataStructures", "Random", "Test"] +git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd" +uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" +version = "0.3.1" + +[[SparseArrays]] +deps = ["LinearAlgebra", "Random"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + +[[SpecialFunctions]] +deps = ["OpenSpecFun_jll"] +git-tree-sha1 = "bf68b90f72f81dd1519b289b7403c591cfdd6a88" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "1.0.0" + +[[StaticArrays]] +deps = ["LinearAlgebra", "Random", "Statistics"] +git-tree-sha1 = "da4cf579416c81994afd6322365d00916c79b8ae" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "0.12.5" + +[[Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[StatsBase]] +deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"] +git-tree-sha1 = "7bab7d4eb46b225b35179632852b595a3162cb61" +uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" +version = "0.33.2" + +[[StatsFuns]] +deps = ["Rmath", "SpecialFunctions"] +git-tree-sha1 = "3b9f665c70712af3264b61c27a7e1d62055dafd1" +uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" +version = "0.9.6" + +[[StatsPlots]] +deps = ["Clustering", "DataStructures", "DataValues", "Distributions", "Interpolations", "KernelDensity", "LinearAlgebra", "MultivariateStats", "Observables", "Plots", "RecipesBase", "RecipesPipeline", "Reexport", "StatsBase", "TableOperations", "Tables", "Widgets"] +git-tree-sha1 = "0904a834846e7f4796636171fe002368e755dffc" +uuid = "f3b207a7-027a-5e70-b257-86293d7955fd" +version = "0.14.17" + +[[StructArrays]] +deps = ["Adapt", "DataAPI", "Tables"] +git-tree-sha1 = "8099ed9fb90b6e754d6ba8c6ed8670f010eadca0" +uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" +version = "0.4.4" + +[[StructTypes]] +deps = ["Dates", "UUIDs"] +git-tree-sha1 = "1ed04f622a39d2e5a6747c3a70be040c00333933" +uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" +version = "1.1.0" + +[[SuiteSparse]] +deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] +uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" + +[[Syslogs]] +deps = ["Printf", "Sockets"] +git-tree-sha1 = "46badfcc7c6e74535cc7d833a91f4ac4f805f86d" +uuid = "cea106d9-e007-5e6c-ad93-58fe2094e9c4" +version = "0.3.0" + +[[TableOperations]] +deps = ["SentinelArrays", "Tables", "Test"] +git-tree-sha1 = "85490cabedd41c56cf7574daec34769e0e2851b9" +uuid = "ab02a1b2-a7df-11e8-156e-fb1833f50b87" +version = "0.3.0" + +[[TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "b1ad568ba658d8cbb3b892ed5380a6f3e781a81e" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.0" + +[[Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"] +git-tree-sha1 = "5131a624173d532299d1c7eb05341c18112b21b8" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.2.1" + +[[Test]] +deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[TimeZones]] +deps = ["Dates", "EzXML", "Mocking", "Pkg", "Printf", "RecipesBase", "Serialization", "Unicode"] +git-tree-sha1 = "e8a5ab7e56d23bf147585001d33d969c655d4091" +uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" +version = "1.5.2" + +[[TranscodingStreams]] +deps = ["Random", "Test"] +git-tree-sha1 = "7c53c35547de1c5b9d46a4797cf6d8253807108c" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.9.5" + +[[UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[VersionParsing]] +git-tree-sha1 = "80229be1f670524750d905f8fc8148e5a8c4537f" +uuid = "81def892-9a0e-5fdd-b105-ffc91e053289" +version = "1.2.0" + +[[Wayland_jll]] +deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "dc643a9b774da1c2781413fd7b6dcd2c56bb8056" +uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89" +version = "1.17.0+4" + +[[Wayland_protocols_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll"] +git-tree-sha1 = "2839f1c1296940218e35df0bbb220f2a79686670" +uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91" +version = "1.18.0+4" + +[[WeakRefStrings]] +deps = ["DataAPI", "Random", "Test"] +git-tree-sha1 = "28807f85197eaad3cbd2330386fac1dcb9e7e11d" +uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5" +version = "0.6.2" + +[[Widgets]] +deps = ["Colors", "Dates", "Observables", "OrderedCollections"] +git-tree-sha1 = "fc0feda91b3fef7fe6948ee09bb628f882b49ca4" +uuid = "cc8bc4a8-27d6-5769-a93b-9d913e69aa62" +version = "0.6.2" + +[[WoodburyMatrices]] +deps = ["LinearAlgebra", "SparseArrays"] +git-tree-sha1 = "59e2ad8fd1591ea019a5259bd012d7aee15f995c" +uuid = "efce3f68-66dc-5838-9240-27a6d6f5f9b6" +version = "0.5.3" + +[[XML2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "be0db24f70aae7e2b89f2f3092e93b8606d659a6" +uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" +version = "2.9.10+3" + +[[XSLT_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "2b3eac39df218762d2d005702d601cd44c997497" +uuid = "aed1982a-8fda-507f-9586-7b0439959a61" +version = "1.1.33+4" + +[[Xorg_libX11_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll", "Xorg_xtrans_jll"] +git-tree-sha1 = "5be649d550f3f4b95308bf0183b82e2582876527" +uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc" +version = "1.6.9+4" + +[[Xorg_libXau_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "4e490d5c960c314f33885790ed410ff3a94ce67e" +uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec" +version = "1.0.9+4" + +[[Xorg_libXcursor_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"] +git-tree-sha1 = "12e0eb3bc634fa2080c1c37fccf56f7c22989afd" +uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724" +version = "1.2.0+4" + +[[Xorg_libXdmcp_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "4fe47bd2247248125c428978740e18a681372dd4" +uuid = "a3789734-cfe1-5b06-b2d0-1dd0d9d62d05" +version = "1.1.3+4" + +[[Xorg_libXext_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "b7c0aa8c376b31e4852b360222848637f481f8c3" +uuid = "1082639a-0dae-5f34-9b06-72781eeb8cb3" +version = "1.3.4+4" + +[[Xorg_libXfixes_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "0e0dc7431e7a0587559f9294aeec269471c991a4" +uuid = "d091e8ba-531a-589c-9de9-94069b037ed8" +version = "5.0.3+4" + +[[Xorg_libXi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXfixes_jll"] +git-tree-sha1 = "89b52bc2160aadc84d707093930ef0bffa641246" +uuid = "a51aa0fd-4e3c-5386-b890-e753decda492" +version = "1.7.10+4" + +[[Xorg_libXinerama_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll"] +git-tree-sha1 = "26be8b1c342929259317d8b9f7b53bf2bb73b123" +uuid = "d1454406-59df-5ea1-beac-c340f2130bc3" +version = "1.1.4+4" + +[[Xorg_libXrandr_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll"] +git-tree-sha1 = "34cea83cb726fb58f325887bf0612c6b3fb17631" +uuid = "ec84b674-ba8e-5d96-8ba1-2a689ba10484" +version = "1.5.2+4" + +[[Xorg_libXrender_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "19560f30fd49f4d4efbe7002a1037f8c43d43b96" +uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa" +version = "0.9.10+4" + +[[Xorg_libpthread_stubs_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6783737e45d3c59a4a4c4091f5f88cdcf0908cbb" +uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74" +version = "0.1.0+3" + +[[Xorg_libxcb_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"] +git-tree-sha1 = "daf17f441228e7a3833846cd048892861cff16d6" +uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b" +version = "1.13.0+3" + +[[Xorg_libxkbfile_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "926af861744212db0eb001d9e40b5d16292080b2" +uuid = "cc61e674-0454-545c-8b26-ed2c68acab7a" +version = "1.1.0+4" + +[[Xorg_xcb_util_image_jll]] +deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "16eb9a5aa027fb877207bf9915686366c2d5c064" +uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b" +version = "0.4.0+0" + +[[Xorg_xcb_util_jll]] +deps = ["Libdl", "Pkg", "Xorg_libxcb_jll"] +git-tree-sha1 = "6b47a94261a67078fe3d3922363bd9fd83b6eb1d" +uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5" +version = "0.4.0+0" + +[[Xorg_xcb_util_keysyms_jll]] +deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "40771f688e17baa121136b649e631e1868a6678e" +uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7" +version = "0.4.0+0" + +[[Xorg_xcb_util_renderutil_jll]] +deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "72c9b59211a97f763a9ca82351d37ebc04a6858a" +uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e" +version = "0.3.9+0" + +[[Xorg_xcb_util_wm_jll]] +deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "6ed52e9bfb2421f01ee62e1a5a30eba5f3f29c74" +uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361" +version = "0.4.1+0" + +[[Xorg_xkbcomp_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxkbfile_jll"] +git-tree-sha1 = "4bcbf660f6c2e714f87e960a171b119d06ee163b" +uuid = "35661453-b289-5fab-8a00-3d9160c6a3a4" +version = "1.4.2+4" + +[[Xorg_xkeyboard_config_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xkbcomp_jll"] +git-tree-sha1 = "5c8424f8a67c3f2209646d4425f3d415fee5931d" +uuid = "33bec58e-1273-512f-9401-5d533626f822" +version = "2.27.0+4" + +[[Xorg_xtrans_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "79c31e7844f6ecf779705fbc12146eb190b7d845" +uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10" +version = "1.4.0+3" + +[[ZMQ]] +deps = ["FileWatching", "Sockets", "ZeroMQ_jll"] +git-tree-sha1 = "fc68e8a3719166950a0f3e390a14c7302c48f8de" +uuid = "c2297ded-f4af-51ae-bb23-16f91089e4e1" +version = "1.2.1" + +[[ZeroMQ_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "bba617292e040408cb72baa03c20f43583bf239f" +uuid = "8f1865be-045e-5c20-9c9f-bfbfb0764568" +version = "4.3.2+5" + +[[ZipFile]] +deps = ["Libdl", "Printf", "Zlib_jll"] +git-tree-sha1 = "c3a5637e27e914a7a445b8d0ad063d701931e9f7" +uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" +version = "0.9.3" + +[[Zlib_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "320228915c8debb12cb434c59057290f0834dbf6" +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.11+18" + +[[Zstd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6f1abcb0c44f184690912aa4b0ba861dd64f11b9" +uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" +version = "1.4.5+2" + +[[libass_jll]] +deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "acc685bcf777b2202a904cdcb49ad34c2fa1880c" +uuid = "0ac62f75-1d6f-5e53-bd7c-93b484bb37c0" +version = "0.14.0+4" + +[[libfdk_aac_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "7a5780a0d9c6864184b3a2eeeb833a0c871f00ab" +uuid = "f638f0a6-7fb0-5443-88ba-1cc74229b280" +version = "0.1.6+4" + +[[libpng_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "6abbc424248097d69c0c87ba50fcb0753f93e0ee" +uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" +version = "1.6.37+6" + +[[libvorbis_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Ogg_jll", "Pkg"] +git-tree-sha1 = "fa14ac25af7a4b8a7f61b287a124df7aab601bcd" +uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" +version = "1.3.6+6" + +[[x264_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "d713c1ce4deac133e3334ee12f4adff07f81778f" +uuid = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a" +version = "2020.7.14+2" + +[[x265_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "487da2f8f2f0c8ee0e83f39d13037d6bbf0a45ab" +uuid = "dfaa095f-4041-5dcd-9319-2fabd8486b76" +version = "3.0.0+3" + +[[xkbcommon_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll", "Wayland_protocols_jll", "Xorg_libxcb_jll", "Xorg_xkeyboard_config_jll"] +git-tree-sha1 = "ece2350174195bb31de1a63bea3a41ae1aa593b6" +uuid = "d8fb68d0-12a3-5cfd-a85a-d49703b185fd" +version = "0.9.1+5" diff --git a/literate_notebooks/src-PT-BR/Project.toml b/literate_notebooks/src-PT-BR/Project.toml new file mode 100644 index 0000000..cfdb47d --- /dev/null +++ b/literate_notebooks/src-PT-BR/Project.toml @@ -0,0 +1,22 @@ +[deps] +Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45" +BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" +CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964" +FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" +FreqTables = "da1fdf0e-e0ff-5433-a45f-9bb5ff651cb1" +IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" +JDF = "babc3d20-cd49-4f60-a736-a8f9c08892d3" +JLSO = "9da8a3cd-07a3-59c0-a743-3fdc52c30d11" +JSONTables = "b9914132-a727-11e9-1322-f18e41205b0b" +NamedArrays = "86f7a689-2022-50b4-a561-43c23ac3c673" +Pipe = "b98c9c47-44ae-5843-9183-064241ee97a0" +PooledArrays = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" +Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" diff --git a/literate_notebooks/src/Manifest.toml b/literate_notebooks/src/Manifest.toml new file mode 100644 index 0000000..03693db --- /dev/null +++ b/literate_notebooks/src/Manifest.toml @@ -0,0 +1,1227 @@ +# This file is machine-generated - editing it directly is not advised + +[[AbstractFFTs]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "051c95d6836228d120f5f4b984dd5aba1624f716" +uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" +version = "0.5.0" + +[[Adapt]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "42c42f2221906892ceb765dbcb1a51deeffd86d7" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "2.3.0" + +[[Arpack]] +deps = ["Arpack_jll", "Libdl", "LinearAlgebra"] +git-tree-sha1 = "2ff92b71ba1747c5fdd541f8fc87736d82f40ec9" +uuid = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97" +version = "0.4.0" + +[[Arpack_jll]] +deps = ["Libdl", "OpenBLAS_jll", "Pkg"] +git-tree-sha1 = "e214a9b9bd1b4e1b4f15b22c0994862b66af7ff7" +uuid = "68821587-b530-5797-8361-c406ea357684" +version = "3.5.0+3" + +[[Arrow]] +deps = ["CodecLz4", "CodecZstd", "DataAPI", "Dates", "Mmap", "PooledArrays", "SentinelArrays", "Tables", "TimeZones"] +git-tree-sha1 = "e2196f539c141a98d66dc50145b67325b7842b1f" +uuid = "69666777-d1a9-59fb-9406-91d4454c9d45" +version = "1.0.1" + +[[Artifacts]] +deps = ["Pkg"] +git-tree-sha1 = "c30985d8821e0cd73870b17b0ed0ce6dc44cb744" +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +version = "1.3.0" + +[[AxisAlgorithms]] +deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"] +git-tree-sha1 = "a4d07a1c313392a77042855df46c5f534076fab9" +uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950" +version = "1.0.0" + +[[BSON]] +git-tree-sha1 = "dd36d7cf3d185eeaaf64db902c15174b22f5dafb" +uuid = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" +version = "0.2.6" + +[[Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[BenchmarkTools]] +deps = ["JSON", "Logging", "Printf", "Statistics", "UUIDs"] +git-tree-sha1 = "9e62e66db34540a0c919d72172cc2f642ac71260" +uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +version = "0.5.0" + +[[Blosc]] +deps = ["Blosc_jll"] +git-tree-sha1 = "84cf7d0f8fd46ca6f1b3e0305b4b4a37afe50fd6" +uuid = "a74b3585-a348-5f62-a45c-50e91977d574" +version = "0.7.0" + +[[Blosc_jll]] +deps = ["Libdl", "Lz4_jll", "Pkg", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "aa9ef39b54a168c3df1b2911e7797e4feee50fbe" +uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9" +version = "1.14.3+1" + +[[BufferedStreams]] +deps = ["Compat", "Test"] +git-tree-sha1 = "5d55b9486590fdda5905c275bb21ce1f0754020f" +uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d" +version = "1.0.0" + +[[Bzip2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "c3598e525718abcc440f69cc6d5f60dda0a1b61e" +uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" +version = "1.0.6+5" + +[[CSV]] +deps = ["Dates", "Mmap", "Parsers", "PooledArrays", "SentinelArrays", "Tables", "Unicode"] +git-tree-sha1 = "290a56b2448024a1501834ee8b7d5d7004bc5ad3" +uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +version = "0.8.2" + +[[Cairo_jll]] +deps = ["Artifacts", "Bzip2_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "e2f47f6d8337369411569fd45ae5753ca10394c6" +uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a" +version = "1.16.0+6" + +[[CategoricalArrays]] +deps = ["DataAPI", "Future", "JSON", "Missings", "Printf", "Statistics", "StructTypes", "Unicode"] +git-tree-sha1 = "5861101791fa76fafe8dddefd70ffbfe4e33ecae" +uuid = "324d7699-5711-5eae-9e2f-1d82baa6b597" +version = "0.9.0" + +[[Clustering]] +deps = ["Distances", "LinearAlgebra", "NearestNeighbors", "Printf", "SparseArrays", "Statistics", "StatsBase"] +git-tree-sha1 = "75479b7df4167267d75294d14b58244695beb2ac" +uuid = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5" +version = "0.14.2" + +[[CodecLz4]] +deps = ["Lz4_jll", "TranscodingStreams"] +git-tree-sha1 = "59fe0cb37784288d6b9f1baebddbf75457395d40" +uuid = "5ba52731-8f18-5e0d-9241-30f10d1ec561" +version = "0.4.0" + +[[CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.0" + +[[CodecZstd]] +deps = ["TranscodingStreams", "Zstd_jll"] +git-tree-sha1 = "d19cd9ae79ef31774151637492291d75194fc5fa" +uuid = "6b39b394-51ab-5f42-8807-6242bab2b4c2" +version = "0.7.0" + +[[ColorSchemes]] +deps = ["ColorTypes", "Colors", "FixedPointNumbers", "Random", "StaticArrays"] +git-tree-sha1 = "5d472aa8908568bc198564db06983913a6c2c8e7" +uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4" +version = "3.10.1" + +[[ColorTypes]] +deps = ["FixedPointNumbers", "Random"] +git-tree-sha1 = "4bffea7ed1a9f0f3d1a131bbcd4b925548d75288" +uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" +version = "0.10.9" + +[[Colors]] +deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Reexport"] +git-tree-sha1 = "008d6bc68dea6beb6303fdc37188cb557391ebf2" +uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" +version = "0.12.4" + +[[Combinatorics]] +git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" +uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" +version = "1.0.2" + +[[Compat]] +deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] +git-tree-sha1 = "a706ff10f1cd8dab94f59fd09c0e657db8e77ff0" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "3.23.0" + +[[CompilerSupportLibraries_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "8e695f735fca77e9708e795eda62afdb869cbb70" +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "0.3.4+0" + +[[Conda]] +deps = ["JSON", "VersionParsing"] +git-tree-sha1 = "c0647249d785f1d5139c0cc96db8f6b32f7ec416" +uuid = "8f4d0f93-b110-5947-807f-2305c1781a2d" +version = "1.5.0" + +[[Contour]] +deps = ["StaticArrays"] +git-tree-sha1 = "0d128f9c2d9560349dc46f60c42036e244271d72" +uuid = "d38c429a-6771-53c6-b99e-75d170b6e991" +version = "0.5.6" + +[[Crayons]] +git-tree-sha1 = "3f71217b538d7aaee0b69ab47d9b7724ca8afa0d" +uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f" +version = "4.0.4" + +[[DataAPI]] +git-tree-sha1 = "ad84f52c0b8f05aa20839484dbaf01690b41ff84" +uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" +version = "1.4.0" + +[[DataFrames]] +deps = ["CategoricalArrays", "Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "20159837c2e5e196793a313cd700b8199fd8f985" +uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +version = "0.22.1" + +[[DataFramesMeta]] +deps = ["DataFrames", "Reexport"] +git-tree-sha1 = "d2b8f08f3b84ba53321d5609a622ad9f61998a6a" +uuid = "1313f7d8-7da2-5740-9ea0-a2ca25f37964" +version = "0.6.0" + +[[DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "fb0aa371da91c1ff9dc7fbed6122d3e411420b9c" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.8" + +[[DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" + +[[DataValues]] +deps = ["DataValueInterfaces", "Dates"] +git-tree-sha1 = "d88a19299eba280a6d062e135a43f00323ae70bf" +uuid = "e7dc6d0d-1eca-5fa6-8ad6-5aecde8b7ea5" +version = "0.4.13" + +[[Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[DelimitedFiles]] +deps = ["Mmap"] +uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" + +[[Distances]] +deps = ["LinearAlgebra", "Statistics"] +git-tree-sha1 = "e8b13ba5f166e11df2de6fc283e5db7864245df0" +uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" +version = "0.10.0" + +[[Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[Distributions]] +deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "StaticArrays", "Statistics", "StatsBase", "StatsFuns"] +git-tree-sha1 = "6493eec6bfb1e578cff879b66844807e3625c83c" +uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" +version = "0.24.4" + +[[DocStringExtensions]] +deps = ["LibGit2", "Markdown", "Pkg", "Test"] +git-tree-sha1 = "50ddf44c53698f5e784bbebb3f4b21c5807401b1" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.8.3" + +[[EarCut_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "92d8f9f208637e8d2d28c664051a00569c01493d" +uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5" +version = "2.1.5+1" + +[[Expat_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "1402e52fcda25064f51c77a9655ce8680b76acf0" +uuid = "2e619515-83b5-522b-bb60-26c02a35a201" +version = "2.2.7+6" + +[[ExprTools]] +git-tree-sha1 = "10407a39b87f29d47ebaca8edbc75d7c302ff93e" +uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" +version = "0.1.3" + +[[EzXML]] +deps = ["Printf", "XML2_jll"] +git-tree-sha1 = "0fa3b52a04a4e210aeb1626def9c90df3ae65268" +uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615" +version = "1.1.0" + +[[FFMPEG]] +deps = ["FFMPEG_jll", "x264_jll"] +git-tree-sha1 = "9a73ffdc375be61b0e4516d83d880b265366fe1f" +uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a" +version = "0.4.0" + +[[FFMPEG_jll]] +deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "LibVPX_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "Pkg", "Zlib_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] +git-tree-sha1 = "3cc57ad0a213808473eafef4845a74766242e05f" +uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" +version = "4.3.1+4" + +[[FFTW]] +deps = ["AbstractFFTs", "FFTW_jll", "IntelOpenMP_jll", "Libdl", "LinearAlgebra", "MKL_jll", "Reexport"] +git-tree-sha1 = "8b7c16b56936047ca41bf25effa137ae0b381ae8" +uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" +version = "1.2.4" + +[[FFTW_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f10c3009373a2d5c4349b8a2932d8accb892892d" +uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a" +version = "3.3.9+6" + +[[FileIO]] +deps = ["Pkg"] +git-tree-sha1 = "cad2e71389ecb2f4480e0de74faab04af13d7929" +uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" +version = "1.4.4" + +[[FilePathsBase]] +deps = ["Dates", "Mmap", "Printf", "Test", "UUIDs"] +git-tree-sha1 = "eea043eb9e9087e53815e9587e9106027c3c6b14" +uuid = "48062228-2e41-5def-b9a4-89aafe57970f" +version = "0.9.5" + +[[FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[FillArrays]] +deps = ["LinearAlgebra", "Random", "SparseArrays"] +git-tree-sha1 = "c1cf9e87a5c45f0c05dc31ae95757f706e70865a" +uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" +version = "0.10.1" + +[[FixedPointNumbers]] +deps = ["Statistics"] +git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" +uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" +version = "0.8.4" + +[[Fontconfig_jll]] +deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "35895cf184ceaab11fd778b4590144034a167a2f" +uuid = "a3f928ae-7b40-5064-980b-68af3947d34b" +version = "2.13.1+14" + +[[Formatting]] +deps = ["Printf"] +git-tree-sha1 = "a0c901c29c0e7c763342751c0a94211d56c0de5c" +uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" +version = "0.4.1" + +[[FreeType2_jll]] +deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "cbd58c9deb1d304f5a245a0b7eb841a2560cfec6" +uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" +version = "2.10.1+5" + +[[FreqTables]] +deps = ["CategoricalArrays", "Missings", "NamedArrays", "Tables"] +git-tree-sha1 = "3adc3eefa0cd2042f2513240f95b36c8ddd0495d" +uuid = "da1fdf0e-e0ff-5433-a45f-9bb5ff651cb1" +version = "0.4.2" + +[[FriBidi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "0d20aed5b14dd4c9a2453c1b601d08e1149679cc" +uuid = "559328eb-81f9-559d-9380-de523a88c83c" +version = "1.0.5+6" + +[[Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + +[[GLFW_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"] +git-tree-sha1 = "a1bbf700b5388bffc3d882f4f4d625cf1c714fd7" +uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89" +version = "3.3.2+1" + +[[GR]] +deps = ["Base64", "DelimitedFiles", "GR_jll", "HTTP", "JSON", "LinearAlgebra", "Pkg", "Printf", "Random", "Serialization", "Sockets", "Test", "UUIDs"] +git-tree-sha1 = "b90b826782cb3ac5b7a7f41b3fd0113180257ed4" +uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" +version = "0.53.0" + +[[GR_jll]] +deps = ["Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Pkg", "Qhull_jll", "Qt_jll", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "daaccb414719ae63625b9b5e0eb4b1ec5b194590" +uuid = "d2c73de3-f751-5644-a686-071e5b155ba9" +version = "0.52.0+0" + +[[GeometryBasics]] +deps = ["EarCut_jll", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"] +git-tree-sha1 = "876a906eab3be990fdcbfe1e43bb3a76f4776f72" +uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326" +version = "0.3.3" + +[[Gettext_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "8c14294a079216000a0bdca5ec5a447f073ddc9d" +uuid = "78b55507-aeef-58d4-861c-77aaff3498b1" +version = "0.20.1+7" + +[[Glib_jll]] +deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "04690cc5008b38ecbdfede949220bc7d9ba26397" +uuid = "7746bdde-850d-59dc-9ae8-88ece973131d" +version = "2.59.0+4" + +[[Grisu]] +git-tree-sha1 = "03d381f65183cb2d0af8b3425fde97263ce9a995" +uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe" +version = "1.0.0" + +[[HTTP]] +deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"] +git-tree-sha1 = "c7ec02c4c6a039a98a15f955462cd7aea5df4508" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "0.8.19" + +[[IJulia]] +deps = ["Base64", "Conda", "Dates", "InteractiveUtils", "JSON", "Markdown", "MbedTLS", "Pkg", "Printf", "REPL", "Random", "SoftGlobalScope", "Test", "UUIDs", "ZMQ"] +git-tree-sha1 = "68e1792f3ca9a0df3b4e59d03a3aca828726917e" +uuid = "7073ff75-c697-5162-941a-fcdaad2a7d2a" +version = "1.23.0" + +[[IniFile]] +deps = ["Test"] +git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8" +uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" +version = "0.5.0" + +[[IntelOpenMP_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "fb8e1c7a5594ba56f9011310790e03b5384998d6" +uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" +version = "2018.0.3+0" + +[[InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[Interpolations]] +deps = ["AxisAlgorithms", "LinearAlgebra", "OffsetArrays", "Random", "Ratios", "SharedArrays", "SparseArrays", "StaticArrays", "WoodburyMatrices"] +git-tree-sha1 = "d2ff0813f0f110918db2537201686575fcf8d345" +uuid = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" +version = "0.13.0" + +[[InvertedIndices]] +deps = ["Test"] +git-tree-sha1 = "15732c475062348b0165684ffe28e85ea8396afc" +uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" +version = "1.0.0" + +[[IterTools]] +git-tree-sha1 = "05110a2ab1fc5f932622ffea2a003221f4782c18" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.3.0" + +[[IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[JDF]] +deps = ["Blosc", "BufferedStreams", "CategoricalArrays", "DataAPI", "DataFrames", "Missings", "PooledArrays", "Serialization", "StatsBase", "Tables", "TimeZones", "WeakRefStrings"] +git-tree-sha1 = "77fcb0f3f55378587bf33b2560417104415f3b9d" +uuid = "babc3d20-cd49-4f60-a736-a8f9c08892d3" +version = "0.2.20" + +[[JLLWrappers]] +git-tree-sha1 = "c70593677bbf2c3ccab4f7500d0f4dacfff7b75c" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.1.3" + +[[JLSO]] +deps = ["BSON", "CodecZlib", "FilePathsBase", "Memento", "Pkg", "Serialization"] +git-tree-sha1 = "85124b548bf4c2bb59284d353aa09ffc224d761f" +uuid = "9da8a3cd-07a3-59c0-a743-3fdc52c30d11" +version = "2.4.0" + +[[JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.1" + +[[JSON3]] +deps = ["Dates", "Mmap", "Parsers", "StructTypes", "UUIDs"] +git-tree-sha1 = "961ef1c3e5c8a595d5bec270a9007429ef12ed10" +uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +version = "1.5.1" + +[[JSONTables]] +deps = ["JSON3", "StructTypes", "Tables"] +git-tree-sha1 = "15ffb1561865803d7a52ed6714408647c9710af6" +uuid = "b9914132-a727-11e9-1322-f18e41205b0b" +version = "1.0.0" + +[[JpegTurbo_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9aff0587d9603ea0de2c6f6300d9f9492bbefbd3" +uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" +version = "2.0.1+3" + +[[KernelDensity]] +deps = ["Distributions", "DocStringExtensions", "FFTW", "Interpolations", "StatsBase"] +git-tree-sha1 = "09aeec87bdc9c1fa70d0b508dfa94a21acd280d9" +uuid = "5ab0869b-81aa-558d-bb23-cbf5423bbe9b" +version = "0.6.2" + +[[LAME_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "df381151e871f41ee86cee4f5f6fd598b8a68826" +uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d" +version = "3.100.0+3" + +[[LZO_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f128cd6cd05ffd6d3df0523ed99b90ff6f9b349a" +uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" +version = "2.10.0+3" + +[[LaTeXStrings]] +git-tree-sha1 = "c7aebfecb1a60d59c0fe023a68ec947a208b1e6b" +uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" +version = "1.2.0" + +[[Latexify]] +deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"] +git-tree-sha1 = "8771ad2b1464aa6188899ca0c3e432341e35f96a" +uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" +version = "0.14.5" + +[[LibGit2]] +deps = ["Printf"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[LibVPX_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "85fcc80c3052be96619affa2fe2e6d2da3908e11" +uuid = "dd192d2f-8180-539f-9fb4-cc70b1dcf69a" +version = "1.9.0+1" + +[[Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[Libffi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "a2cd088a88c0d37eef7d209fd3d8712febce0d90" +uuid = "e9f186c6-92d2-5b65-8a66-fee21dc1b490" +version = "3.2.1+4" + +[[Libgcrypt_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgpg_error_jll", "Pkg"] +git-tree-sha1 = "b391a18ab1170a2e568f9fb8d83bc7c780cb9999" +uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4" +version = "1.8.5+4" + +[[Libglvnd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll", "Xorg_libXext_jll"] +git-tree-sha1 = "7739f837d6447403596a75d19ed01fd08d6f56bf" +uuid = "7e76a0d4-f3c7-5321-8279-8d96eeed0f29" +version = "1.3.0+3" + +[[Libgpg_error_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "ec7f2e8ad5c9fa99fc773376cdbc86d9a5a23cb7" +uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8" +version = "1.36.0+3" + +[[Libiconv_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "8e924324b2e9275a51407a4e06deb3455b1e359f" +uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" +version = "1.16.0+7" + +[[Libmount_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "51ad0c01c94c1ce48d5cad629425035ad030bfd5" +uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9" +version = "2.34.0+3" + +[[Libtiff_jll]] +deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "291dd857901f94d683973cdf679984cdf73b56d0" +uuid = "89763e89-9b03-5906-acba-b20f662cd828" +version = "4.1.0+2" + +[[Libuuid_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f879ae9edbaa2c74c922e8b85bb83cc84ea1450b" +uuid = "38a345b3-de98-5d2b-a5d3-14cd9215e700" +version = "2.34.0+7" + +[[LinearAlgebra]] +deps = ["Libdl"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[Lz4_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "51b1db0732bbdcfabb60e36095cc3ed9c0016932" +uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" +version = "1.9.2+2" + +[[MKL_jll]] +deps = ["IntelOpenMP_jll", "Libdl", "Pkg"] +git-tree-sha1 = "eb540ede3aabb8284cb482aa41d00d6ca850b1f8" +uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7" +version = "2020.2.254+0" + +[[MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "6a8a2a625ab0dea913aba95c11370589e0239ff0" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.6" + +[[Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[MbedTLS]] +deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"] +git-tree-sha1 = "1c38e51c3d08ef2278062ebceade0e46cefc96fe" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "1.0.3" + +[[MbedTLS_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "0eef589dd1c26a3ac9d753fe1a8bcad63f956fa6" +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.16.8+1" + +[[Measures]] +git-tree-sha1 = "e498ddeee6f9fdb4551ce855a46f54dbd900245f" +uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e" +version = "0.3.1" + +[[Memento]] +deps = ["Dates", "Distributed", "JSON", "Serialization", "Sockets", "Syslogs", "Test", "TimeZones", "UUIDs"] +git-tree-sha1 = "d6dfb54d7e8a9b4a2b1773acf7275a4f607906b2" +uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9" +version = "1.1.2" + +[[Missings]] +deps = ["DataAPI"] +git-tree-sha1 = "ed61674a0864832495ffe0a7e889c0da76b0f4c8" +uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" +version = "0.4.4" + +[[Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[Mocking]] +deps = ["ExprTools"] +git-tree-sha1 = "916b850daad0d46b8c71f65f719c49957e9513ed" +uuid = "78c3b35d-d492-501b-9361-3d52fe80e533" +version = "0.7.1" + +[[MultivariateStats]] +deps = ["Arpack", "LinearAlgebra", "SparseArrays", "Statistics", "StatsBase"] +git-tree-sha1 = "352fae519b447bf52e6de627b89f448bcd469e4e" +uuid = "6f286f6a-111f-5878-ab1e-185364afe411" +version = "0.7.0" + +[[NaNMath]] +git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "0.3.5" + +[[NamedArrays]] +deps = ["Combinatorics", "DataStructures", "DelimitedFiles", "InvertedIndices", "LinearAlgebra", "Random", "Requires", "SparseArrays", "Statistics"] +git-tree-sha1 = "7d96d4c09526458d66ff84d7648be7eb7c38a547" +uuid = "86f7a689-2022-50b4-a561-43c23ac3c673" +version = "0.9.4" + +[[NearestNeighbors]] +deps = ["Distances", "StaticArrays"] +git-tree-sha1 = "da77adc83db31176804ce8307e61ef5bedca2e58" +uuid = "b8a86587-4115-5ab1-83bc-aa920d37bbce" +version = "0.4.7" + +[[Observables]] +git-tree-sha1 = "635fe10760447cfa86f5118edf2f47eb864fb495" +uuid = "510215fc-4207-5dde-b226-833fc4488ee2" +version = "0.3.2" + +[[OffsetArrays]] +deps = ["Adapt"] +git-tree-sha1 = "9db93b990af57b3a56dca38476832f60d58f777b" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.4.0" + +[[Ogg_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "a42c0f138b9ebe8b58eba2271c5053773bde52d0" +uuid = "e7412a2a-1a6e-54c0-be00-318e2571c051" +version = "1.3.4+2" + +[[OpenBLAS_jll]] +deps = ["CompilerSupportLibraries_jll", "Libdl", "Pkg"] +git-tree-sha1 = "0c922fd9634e358622e333fc58de61f05a048492" +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.9+5" + +[[OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "71bbbc616a1d710879f5a1021bcba65ffba6ce58" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.1+6" + +[[OpenSpecFun_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9db77584158d0ab52307f8c04f8e7c08ca76b5b3" +uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" +version = "0.5.3+4" + +[[Opus_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f9d57f4126c39565e05a2b0264df99f497fc6f37" +uuid = "91d4177d-7536-5919-b921-800302f37372" +version = "1.3.1+3" + +[[OrderedCollections]] +git-tree-sha1 = "cf59cfed2e2c12e8a2ff0a4f1e9b2cd8650da6db" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.3.2" + +[[PCRE_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "1b556ad51dceefdbf30e86ffa8f528b73c7df2bb" +uuid = "2f80f16e-611a-54ab-bc61-aa92de5b98fc" +version = "8.42.0+4" + +[[PDMats]] +deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse", "Test"] +git-tree-sha1 = "95a4038d1011dfdbde7cecd2ad0ac411e53ab1bc" +uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" +version = "0.10.1" + +[[Parsers]] +deps = ["Dates"] +git-tree-sha1 = "b417be52e8be24e916e34b3d70ec2da7bdf56a68" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "1.0.12" + +[[Pipe]] +git-tree-sha1 = "6842804e7867b115ca9de748a0cf6b364523c16d" +uuid = "b98c9c47-44ae-5843-9183-064241ee97a0" +version = "1.3.0" + +[[Pixman_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "392d85fe2fd2c613442f9694dd566c0d5641d58c" +uuid = "30392449-352a-5448-841d-b1acce4e97dc" +version = "0.38.4+5" + +[[Pkg]] +deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" + +[[PlotThemes]] +deps = ["PlotUtils", "Requires", "Statistics"] +git-tree-sha1 = "c6f5ea535551b3b16835134697f0c65d06c94b91" +uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a" +version = "2.0.0" + +[[PlotUtils]] +deps = ["ColorSchemes", "Colors", "Dates", "Printf", "Random", "Reexport", "Statistics"] +git-tree-sha1 = "4e098f88dad9a2b518b83124a116be1c49e2b2bf" +uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043" +version = "1.0.7" + +[[Plots]] +deps = ["Base64", "Contour", "Dates", "FFMPEG", "FixedPointNumbers", "GR", "GeometryBasics", "JSON", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "PlotThemes", "PlotUtils", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs"] +git-tree-sha1 = "173c7250ccd7c98615b04c669eb13fa7fab494b0" +uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +version = "1.9.1" + +[[PooledArrays]] +deps = ["DataAPI"] +git-tree-sha1 = "b1333d4eced1826e15adbdf01a4ecaccca9d353c" +uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" +version = "0.5.3" + +[[PrettyTables]] +deps = ["Crayons", "Formatting", "Markdown", "Reexport", "Tables"] +git-tree-sha1 = "237170206bf38a66fee4d845f4ae57f63788eeb0" +uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" +version = "0.10.1" + +[[Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[Qhull_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "585989201bf8741e165ae52df54de79c5299daa7" +uuid = "784f63db-0788-585a-bace-daefebcd302b" +version = "2019.1.0+2" + +[[Qt_jll]] +deps = ["Artifacts", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"] +git-tree-sha1 = "72244a8e084251aea25968c61bbf5c001aaa7d5a" +uuid = "ede63266-ebff-546c-83e0-1c6fb6d0efc8" +version = "5.15.1+0" + +[[QuadGK]] +deps = ["DataStructures", "LinearAlgebra"] +git-tree-sha1 = "12fbe86da16df6679be7521dfb39fbc861e1dc7b" +uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" +version = "2.4.1" + +[[REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[Random]] +deps = ["Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[Ratios]] +git-tree-sha1 = "37d210f612d70f3f7d57d488cb3b6eff56ad4e41" +uuid = "c84ed2f1-dad5-54f0-aa8e-dbefe2724439" +version = "0.4.0" + +[[RecipesBase]] +git-tree-sha1 = "b3fb709f3c97bfc6e948be68beeecb55a0b340ae" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.1.1" + +[[RecipesPipeline]] +deps = ["Dates", "NaNMath", "PlotUtils", "RecipesBase"] +git-tree-sha1 = "9ea2f5bf1b26918b16e9f885bb8e05206bfc2144" +uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c" +version = "0.2.1" + +[[Reexport]] +deps = ["Pkg"] +git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0" +uuid = "189a3867-3050-52da-a836-e630ba90ab69" +version = "0.2.0" + +[[Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "e05c53ebc86933601d36212a93b39144a2733493" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.1.1" + +[[Rmath]] +deps = ["Random", "Rmath_jll"] +git-tree-sha1 = "86c5647b565873641538d8f812c04e4c9dbeb370" +uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" +version = "0.6.1" + +[[Rmath_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "d76185aa1f421306dec73c057aa384bad74188f0" +uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" +version = "0.2.2+1" + +[[SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" + +[[Scratch]] +deps = ["Dates"] +git-tree-sha1 = "ad4b278adb62d185bbcb6864dc24959ab0627bf6" +uuid = "6c6a2e73-6563-6170-7368-637461726353" +version = "1.0.3" + +[[SentinelArrays]] +deps = ["Dates", "Random"] +git-tree-sha1 = "6ccde405cf0759eba835eb613130723cb8f10ff9" +uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" +version = "1.2.16" + +[[Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[SharedArrays]] +deps = ["Distributed", "Mmap", "Random", "Serialization"] +uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" + +[[Showoff]] +deps = ["Dates", "Grisu"] +git-tree-sha1 = "ee010d8f103468309b8afac4abb9be2e18ff1182" +uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f" +version = "0.3.2" + +[[Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[SoftGlobalScope]] +deps = ["REPL"] +git-tree-sha1 = "986ec2b6162ccb95de5892ed17832f95badf770c" +uuid = "b85f4697-e234-5449-a836-ec8e2f98b302" +version = "1.1.0" + +[[SortingAlgorithms]] +deps = ["DataStructures", "Random", "Test"] +git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd" +uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" +version = "0.3.1" + +[[SparseArrays]] +deps = ["LinearAlgebra", "Random"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + +[[SpecialFunctions]] +deps = ["OpenSpecFun_jll"] +git-tree-sha1 = "bf68b90f72f81dd1519b289b7403c591cfdd6a88" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "1.0.0" + +[[StaticArrays]] +deps = ["LinearAlgebra", "Random", "Statistics"] +git-tree-sha1 = "da4cf579416c81994afd6322365d00916c79b8ae" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "0.12.5" + +[[Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[[StatsBase]] +deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"] +git-tree-sha1 = "7bab7d4eb46b225b35179632852b595a3162cb61" +uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" +version = "0.33.2" + +[[StatsFuns]] +deps = ["Rmath", "SpecialFunctions"] +git-tree-sha1 = "3b9f665c70712af3264b61c27a7e1d62055dafd1" +uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" +version = "0.9.6" + +[[StatsPlots]] +deps = ["Clustering", "DataStructures", "DataValues", "Distributions", "Interpolations", "KernelDensity", "LinearAlgebra", "MultivariateStats", "Observables", "Plots", "RecipesBase", "RecipesPipeline", "Reexport", "StatsBase", "TableOperations", "Tables", "Widgets"] +git-tree-sha1 = "0904a834846e7f4796636171fe002368e755dffc" +uuid = "f3b207a7-027a-5e70-b257-86293d7955fd" +version = "0.14.17" + +[[StructArrays]] +deps = ["Adapt", "DataAPI", "Tables"] +git-tree-sha1 = "8099ed9fb90b6e754d6ba8c6ed8670f010eadca0" +uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" +version = "0.4.4" + +[[StructTypes]] +deps = ["Dates", "UUIDs"] +git-tree-sha1 = "1ed04f622a39d2e5a6747c3a70be040c00333933" +uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" +version = "1.1.0" + +[[SuiteSparse]] +deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] +uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" + +[[Syslogs]] +deps = ["Printf", "Sockets"] +git-tree-sha1 = "46badfcc7c6e74535cc7d833a91f4ac4f805f86d" +uuid = "cea106d9-e007-5e6c-ad93-58fe2094e9c4" +version = "0.3.0" + +[[TableOperations]] +deps = ["SentinelArrays", "Tables", "Test"] +git-tree-sha1 = "85490cabedd41c56cf7574daec34769e0e2851b9" +uuid = "ab02a1b2-a7df-11e8-156e-fb1833f50b87" +version = "0.3.0" + +[[TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "b1ad568ba658d8cbb3b892ed5380a6f3e781a81e" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.0" + +[[Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"] +git-tree-sha1 = "5131a624173d532299d1c7eb05341c18112b21b8" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.2.1" + +[[Test]] +deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[TimeZones]] +deps = ["Dates", "EzXML", "Mocking", "Pkg", "Printf", "RecipesBase", "Serialization", "Unicode"] +git-tree-sha1 = "e8a5ab7e56d23bf147585001d33d969c655d4091" +uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" +version = "1.5.2" + +[[TranscodingStreams]] +deps = ["Random", "Test"] +git-tree-sha1 = "7c53c35547de1c5b9d46a4797cf6d8253807108c" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.9.5" + +[[UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[VersionParsing]] +git-tree-sha1 = "80229be1f670524750d905f8fc8148e5a8c4537f" +uuid = "81def892-9a0e-5fdd-b105-ffc91e053289" +version = "1.2.0" + +[[Wayland_jll]] +deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "dc643a9b774da1c2781413fd7b6dcd2c56bb8056" +uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89" +version = "1.17.0+4" + +[[Wayland_protocols_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll"] +git-tree-sha1 = "2839f1c1296940218e35df0bbb220f2a79686670" +uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91" +version = "1.18.0+4" + +[[WeakRefStrings]] +deps = ["DataAPI", "Random", "Test"] +git-tree-sha1 = "28807f85197eaad3cbd2330386fac1dcb9e7e11d" +uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5" +version = "0.6.2" + +[[Widgets]] +deps = ["Colors", "Dates", "Observables", "OrderedCollections"] +git-tree-sha1 = "fc0feda91b3fef7fe6948ee09bb628f882b49ca4" +uuid = "cc8bc4a8-27d6-5769-a93b-9d913e69aa62" +version = "0.6.2" + +[[WoodburyMatrices]] +deps = ["LinearAlgebra", "SparseArrays"] +git-tree-sha1 = "59e2ad8fd1591ea019a5259bd012d7aee15f995c" +uuid = "efce3f68-66dc-5838-9240-27a6d6f5f9b6" +version = "0.5.3" + +[[XML2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "be0db24f70aae7e2b89f2f3092e93b8606d659a6" +uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" +version = "2.9.10+3" + +[[XSLT_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "2b3eac39df218762d2d005702d601cd44c997497" +uuid = "aed1982a-8fda-507f-9586-7b0439959a61" +version = "1.1.33+4" + +[[Xorg_libX11_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll", "Xorg_xtrans_jll"] +git-tree-sha1 = "5be649d550f3f4b95308bf0183b82e2582876527" +uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc" +version = "1.6.9+4" + +[[Xorg_libXau_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "4e490d5c960c314f33885790ed410ff3a94ce67e" +uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec" +version = "1.0.9+4" + +[[Xorg_libXcursor_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"] +git-tree-sha1 = "12e0eb3bc634fa2080c1c37fccf56f7c22989afd" +uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724" +version = "1.2.0+4" + +[[Xorg_libXdmcp_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "4fe47bd2247248125c428978740e18a681372dd4" +uuid = "a3789734-cfe1-5b06-b2d0-1dd0d9d62d05" +version = "1.1.3+4" + +[[Xorg_libXext_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "b7c0aa8c376b31e4852b360222848637f481f8c3" +uuid = "1082639a-0dae-5f34-9b06-72781eeb8cb3" +version = "1.3.4+4" + +[[Xorg_libXfixes_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "0e0dc7431e7a0587559f9294aeec269471c991a4" +uuid = "d091e8ba-531a-589c-9de9-94069b037ed8" +version = "5.0.3+4" + +[[Xorg_libXi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXfixes_jll"] +git-tree-sha1 = "89b52bc2160aadc84d707093930ef0bffa641246" +uuid = "a51aa0fd-4e3c-5386-b890-e753decda492" +version = "1.7.10+4" + +[[Xorg_libXinerama_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll"] +git-tree-sha1 = "26be8b1c342929259317d8b9f7b53bf2bb73b123" +uuid = "d1454406-59df-5ea1-beac-c340f2130bc3" +version = "1.1.4+4" + +[[Xorg_libXrandr_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll"] +git-tree-sha1 = "34cea83cb726fb58f325887bf0612c6b3fb17631" +uuid = "ec84b674-ba8e-5d96-8ba1-2a689ba10484" +version = "1.5.2+4" + +[[Xorg_libXrender_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "19560f30fd49f4d4efbe7002a1037f8c43d43b96" +uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa" +version = "0.9.10+4" + +[[Xorg_libpthread_stubs_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6783737e45d3c59a4a4c4091f5f88cdcf0908cbb" +uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74" +version = "0.1.0+3" + +[[Xorg_libxcb_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"] +git-tree-sha1 = "daf17f441228e7a3833846cd048892861cff16d6" +uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b" +version = "1.13.0+3" + +[[Xorg_libxkbfile_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "926af861744212db0eb001d9e40b5d16292080b2" +uuid = "cc61e674-0454-545c-8b26-ed2c68acab7a" +version = "1.1.0+4" + +[[Xorg_xcb_util_image_jll]] +deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "16eb9a5aa027fb877207bf9915686366c2d5c064" +uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b" +version = "0.4.0+0" + +[[Xorg_xcb_util_jll]] +deps = ["Libdl", "Pkg", "Xorg_libxcb_jll"] +git-tree-sha1 = "6b47a94261a67078fe3d3922363bd9fd83b6eb1d" +uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5" +version = "0.4.0+0" + +[[Xorg_xcb_util_keysyms_jll]] +deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "40771f688e17baa121136b649e631e1868a6678e" +uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7" +version = "0.4.0+0" + +[[Xorg_xcb_util_renderutil_jll]] +deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "72c9b59211a97f763a9ca82351d37ebc04a6858a" +uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e" +version = "0.3.9+0" + +[[Xorg_xcb_util_wm_jll]] +deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "6ed52e9bfb2421f01ee62e1a5a30eba5f3f29c74" +uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361" +version = "0.4.1+0" + +[[Xorg_xkbcomp_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxkbfile_jll"] +git-tree-sha1 = "4bcbf660f6c2e714f87e960a171b119d06ee163b" +uuid = "35661453-b289-5fab-8a00-3d9160c6a3a4" +version = "1.4.2+4" + +[[Xorg_xkeyboard_config_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xkbcomp_jll"] +git-tree-sha1 = "5c8424f8a67c3f2209646d4425f3d415fee5931d" +uuid = "33bec58e-1273-512f-9401-5d533626f822" +version = "2.27.0+4" + +[[Xorg_xtrans_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "79c31e7844f6ecf779705fbc12146eb190b7d845" +uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10" +version = "1.4.0+3" + +[[ZMQ]] +deps = ["FileWatching", "Sockets", "ZeroMQ_jll"] +git-tree-sha1 = "fc68e8a3719166950a0f3e390a14c7302c48f8de" +uuid = "c2297ded-f4af-51ae-bb23-16f91089e4e1" +version = "1.2.1" + +[[ZeroMQ_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "bba617292e040408cb72baa03c20f43583bf239f" +uuid = "8f1865be-045e-5c20-9c9f-bfbfb0764568" +version = "4.3.2+5" + +[[ZipFile]] +deps = ["Libdl", "Printf", "Zlib_jll"] +git-tree-sha1 = "c3a5637e27e914a7a445b8d0ad063d701931e9f7" +uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" +version = "0.9.3" + +[[Zlib_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "320228915c8debb12cb434c59057290f0834dbf6" +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.11+18" + +[[Zstd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6f1abcb0c44f184690912aa4b0ba861dd64f11b9" +uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" +version = "1.4.5+2" + +[[libass_jll]] +deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "acc685bcf777b2202a904cdcb49ad34c2fa1880c" +uuid = "0ac62f75-1d6f-5e53-bd7c-93b484bb37c0" +version = "0.14.0+4" + +[[libfdk_aac_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "7a5780a0d9c6864184b3a2eeeb833a0c871f00ab" +uuid = "f638f0a6-7fb0-5443-88ba-1cc74229b280" +version = "0.1.6+4" + +[[libpng_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "6abbc424248097d69c0c87ba50fcb0753f93e0ee" +uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" +version = "1.6.37+6" + +[[libvorbis_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Ogg_jll", "Pkg"] +git-tree-sha1 = "fa14ac25af7a4b8a7f61b287a124df7aab601bcd" +uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" +version = "1.3.6+6" + +[[x264_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "d713c1ce4deac133e3334ee12f4adff07f81778f" +uuid = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a" +version = "2020.7.14+2" + +[[x265_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "487da2f8f2f0c8ee0e83f39d13037d6bbf0a45ab" +uuid = "dfaa095f-4041-5dcd-9319-2fabd8486b76" +version = "3.0.0+3" + +[[xkbcommon_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll", "Wayland_protocols_jll", "Xorg_libxcb_jll", "Xorg_xkeyboard_config_jll"] +git-tree-sha1 = "ece2350174195bb31de1a63bea3a41ae1aa593b6" +uuid = "d8fb68d0-12a3-5cfd-a85a-d49703b185fd" +version = "0.9.1+5" diff --git a/literate_notebooks/src/Project.toml b/literate_notebooks/src/Project.toml new file mode 100644 index 0000000..cfdb47d --- /dev/null +++ b/literate_notebooks/src/Project.toml @@ -0,0 +1,22 @@ +[deps] +Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45" +BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" +CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964" +FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" +FreqTables = "da1fdf0e-e0ff-5433-a45f-9bb5ff651cb1" +IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" +JDF = "babc3d20-cd49-4f60-a736-a8f9c08892d3" +JLSO = "9da8a3cd-07a3-59c0-a743-3fdc52c30d11" +JSONTables = "b9914132-a727-11e9-1322-f18e41205b0b" +NamedArrays = "86f7a689-2022-50b4-a561-43c23ac3c673" +Pipe = "b98c9c47-44ae-5843-9183-064241ee97a0" +PooledArrays = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" +Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea" From bf69bd879c82394fd5cbb178d4a5a5a588b6a1e7 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Mon, 19 Apr 2021 10:18:22 -0300 Subject: [PATCH 07/20] translated 01_constructors.jl --- .../src-PT-BR/01_constructors.jl | 117 +++++++++--------- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a/literate_notebooks/src-PT-BR/01_constructors.jl b/literate_notebooks/src-PT-BR/01_constructors.jl index 333a81e..7eb1e5c 100644 --- a/literate_notebooks/src-PT-BR/01_constructors.jl +++ b/literate_notebooks/src-PT-BR/01_constructors.jl @@ -1,143 +1,144 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** -# -# Let's get started by loading the `DataFrames` package. +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). +# +# Vamos começar carregando o pacote `DataFrames` using DataFrames -# ## Constructors and conversion +# ## Construtores e conversões -#- +# - -# ### Constructors -# -# In this section, you'll see many ways to create a `DataFrame` using the `DataFrame()` constructor. -# -# First, we could create an empty DataFrame, +# ### Construtores +# +# Nesta seção, você verá as diferentes maneiras de criar um `DataFrame` usando o construtor `DataFrame()` +# +# Primeiramente, é possível criar um `DataFrame` vazio -DataFrame() # empty DataFrame +DataFrame() # DataFrame vazio -# Or we could call the constructor using keyword arguments to add columns to the `DataFrame`. +# Podemos também passar argumentos de palavras-chave (*keyword arguments*) no construtor para adicionar colunas ao `DataFrame`. DataFrame(A=1:3, B=rand(3), C=randstring.([3,3,3])) -# We can create a `DataFrame` from a dictionary, in which case keys from the dictionary will be sorted to create the `DataFrame` columns. +# Podemos criar um `DataFrame` a partir de um dicionário, caso em que as chaves do dicionário serão usadas para criar as colunas do `DataFrame`. x = Dict("A" => [1,2], "B" => [true, false], "C" => ['a', 'b']) DataFrame(x) -# Rather than explicitly creating a dictionary first, as above, we could pass `DataFrame` arguments with the syntax of dictionary key-value pairs. -# -# Note that in this case, we use symbols to denote the column names and arguments are not sorted. For example, `:A`, the symbol, produces `A`, the name of the first column here: +# Em vez de criar explicitamente um dicionário primeiro, como acima, poderíamos passar argumentos `DataFrame` com a sintaxe dos pares chave-valor do dicionário. +# +# Observe que, neste caso, usamos símbolos para denotar os nomes das colunas e os argumentos não são ordenados. Por exemplo, o símbolo `:A`produz`A` que será o nome da primeira coluna aqui: DataFrame(:A => [1,2], :B => [true, false], :C => ['a', 'b']) -# Here we create a `DataFrame` from a vector of vectors, and each vector becomes a column. +# Aqui criamos um `DataFrame` a partir de um vetor de vetores, e cada vetor se torna uma coluna. DataFrame([rand(3) for i in 1:3]) -# For now we can construct a single `DataFrame` from a `Vector` of atoms, creating a `DataFrame` with a single row. In future releases of DataFrames.jl, this will throw an error. +# Por enquanto, podemos construir um único `DataFrame` a partir de um `Vector` atômico, criando um `DataFrame` com uma única linha. Em versões futuras de DataFrames.jl, isso gerará um erro. DataFrame(rand(3)) -# Instead use a transposed vector if you have a vector of atoms (in this way you effectively pass a two dimensional array to the constructor which is supported). +# Em vez disso, use um vetor transposto se você tiver um vetor atômico (dessa forma, você passa efetivamente uma array bidimensional para o construtor o que é compatível). DataFrame(transpose([1, 2, 3])) -# Pass a second argument to give the columns names. +# Passe um segundo argumento para dar nomes às colunas. DataFrame([1:3, 4:6, 7:9], [:A, :B, :C]) -# Here we create a `DataFrame` from a matrix, +# Aqui nós criamos um `DataFrame` de uma matriz, -DataFrame(rand(3,4)) +DataFrame(rand(3, 4)) -# and here we do the same but also pass column names. +# e aqui nós fazemos o mesmo mas também passando nomes de colunas. -DataFrame(rand(3,4), Symbol.('a':'d')) +DataFrame(rand(3, 4), Symbol.('a':'d')) -# We can also construct an uninitialized DataFrame. -# -# Here we pass column types, names and number of rows; we get `missing` in column :C because `Any >: Missing`. +# Podemos também construir um `DataFrame` não-inicializado. +# +# Aqui passamos os tipos de coluna, nomes e número de linhas; obtemos `missing` na coluna `:C` porque `Any >: Missing`. DataFrame([Int, Float64, Any], [:A, :B, :C], 1) -# Here we create a `DataFrame`, but column `:C` is #undef and Jupyter has problem with displaying it. (This works OK at the REPL.) -# -# This will be fixed in next release of DataFrames! +# Aqui criamos um `DataFrame`, mas a coluna`:C` é #undef e o Jupyter tem problemas para exibi-la. (Isso funciona OK no REPL.) +# +# Isto será consertado na próxima versão do DataFrames! DataFrame([Int, Float64, String], [:A, :B, :C], 1) -# To initialize a `DataFrame` with column names, but no rows use +# Para inicializar um `DataFrame` com nomes de colunas, mas sem linhas use -DataFrame([Int, Float64, String], [:A, :B, :C], 0) +DataFrame([Int, Float64, String], [:A, :B, :C], 0) -# This syntax gives us a quick way to create homogenous `DataFrame`. +# Essa sintaxe permite uma maneira rápida de criar um `DataFrame` homogêneo: DataFrame(Int, 3, 5) -# This example is similar, but has nonhomogenous columns. +# Esse exemplo é similar, mas possui colunas não-homogêneas. DataFrame([Int, Float64], 4) -# Finally, we can create a `DataFrame` by copying an existing `DataFrame`. -# -# Note that `copy` creates a shallow copy. +# Finalmente, podemos criar um `DataFrame` copiando um `DataFrame` existente. +# +# Note que `copy` cria uma cópia raza. y = DataFrame(x) z = copy(x) (x === y), (x === z), isequal(x, z) -# ### Conversion to a matrix -# -# Let's start by creating a `DataFrame` with two rows and two columns. +# ### Conversões para Matrizes +# +# Vamos começar criando um `DataFrame` com duas linhas e duas colunas. x = DataFrame(x=1:2, y=["A", "B"]) -# We can create a matrix by passing this `DataFrame` to `Matrix`. +# Podemos criar uma matriz passando esse `DataFrame` para `Matrix`. Matrix(x) -# This would work even if the `DataFrame` had some `missing`s: +# Isso funciona mesmo se `DataFrame` possuir alguns `missing`s: x = DataFrame(x=1:2, y=[missing,"B"]) -#- +# - Matrix(x) -# In the two previous matrix examples, Julia created matrices with elements of type `Any`. We can see more clearly that the type of matrix is inferred when we pass, for example, a `DataFrame` of integers to `Matrix`, creating a 2D `Array` of `Int64`s: +# Nos dois exemplos de matriz anteriores, Julia criou matrizes com elementos do tipo `Any`. Podemos ver mais claramente que o tipo de matriz é inferido quando passamos, por exemplo, um `DataFrame` de inteiros para`Matrix`, criando um `Array` 2D de `Int64`s: x = DataFrame(x=1:2, y=3:4) -#- +# - Matrix(x) -# In this next example, Julia correctly identifies that `Union` is needed to express the type of the resulting `Matrix` (which contains `missing`s). +# No próximo exemplo, Julia identifica corretamente que `Union` é necessário para expressar o tipo resultante de `Matrix` (que contém `missing`s). x = DataFrame(x=1:2, y=[missing,4]) -#- +# - Matrix(x) -# Note that we can't force a conversion of `missing` values to `Int`s! +# Note que não conseguimos forçar uma conversão de valores `missing` para `Int`s! Matrix{Int}(x) -# ### Handling of duplicate column names -# -# We can pass the `makeunique` keyword argument to allow passing duplicate names (they get deduplicated) +# ### Lidando com nomes de colunas duplicados +# +# Nós podemos passar o argumento de palavra-chave `makeunique` para permitir o uso de nomes duplicados de colunas (eles serão "deduplicados") -df = DataFrame(:a=>1, :a=>2, :a_1=>3; makeunique=true) +df = DataFrame(:a => 1, :a => 2, :a_1 => 3; makeunique=true) -# Otherwise, duplicates will not be allowed in the future. +# Caso contrário, nomes duplicados não serão permitidos no futuro. -df = DataFrame(:a=>1, :a=>2, :a_1=>3) +df = DataFrame(:a => 1, :a => 2, :a_1 => 3) -# A constructor that is passed column names as keyword arguments is a corner case. -# You cannot pass `makeunique` to allow duplicates here. +# Um construtor que recebe nomes de coluna como argumentos de palavra-chave é um caso excepcional. +# Não é permitido usar `makeunique` aqui para permitir nomes duplicados. df = DataFrame(a=1, a=2, makeunique=true) - From b63ce3ea54424ca46e3512349a42fa908dd78c01 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Mon, 19 Apr 2021 10:41:35 -0300 Subject: [PATCH 08/20] translated 02_basicinfo.jl --- literate_notebooks/src-PT-BR/02_basicinfo.jl | 49 ++++++++++---------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/literate_notebooks/src-PT-BR/02_basicinfo.jl b/literate_notebooks/src-PT-BR/02_basicinfo.jl index 6cde7c6..ea07703 100644 --- a/literate_notebooks/src-PT-BR/02_basicinfo.jl +++ b/literate_notebooks/src-PT-BR/02_basicinfo.jl @@ -1,76 +1,77 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). using DataFrames # load package -# ## Getting basic information about a data frame -# -# Let's start by creating a `DataFrame` object, `x`, so that we can learn how to get information on that data frame. +# ## Obtendo informações básicas sobre um data frame +# +# Vamos começar criando um objeto `DataFrame`, `x`, para que possamos aprender como obter informações sobre um data frame. -x = DataFrame(A = [1, 2], B = [1.0, missing], C = ["a", "b"]) +x = DataFrame(A=[1, 2], B=[1.0, missing], C=["a", "b"]) -# The standard `size` function works to get dimensions of the `DataFrame`, +# A função padrão `size` é uma maneira de obter as dimensões do `DataFrame`, size(x), size(x, 1), size(x, 2) -# as well as `nrow` and `ncol` from R; `length` gives number of columns. +# assim como `nrow` e `ncol` oriundas do R; `length` retorna o número de colunas. nrow(x), ncol(x), length(x) -# `describe` gives basic summary statistics of data in your `DataFrame`. +# `describe` retorna estatísticas descritivas básicas dos dados do seu `DataFrame`. describe(x) -# Use `showcols` to get informaton about columns stored in a DataFrame. +# Use `showcols` para conseguir informações sobre as colunas armazenadas em um DataFrame. showcols(x) -# `names` will return the names of all columns, +# `names` retornará os nomes de todas as colunas, names(x) -# and `eltypes` returns their types. +# e `eltypes` retorna os seus tipos. eltypes(x) -# Here we create some large DataFrame +# Vamos criar um DataFrame grande y = DataFrame(rand(1:10, 1000, 10)); -# and then we can use `head` to peek into its top rows +# com isso podemos usar `head` para ter uma visão rápida das linhas superiores head(y) -# and `tail` to see its bottom rows. +# e `tail` para ver suas linhas inferiores. tail(y, 3) -# ### Most elementary get and set operations -# -# Given the `DataFrame`, `x`, here are three ways to grab one of its columns as a `Vector`: +# ### As funções *get* e *set* mais elementares +# +# Dado o `DataFrame` `x`, aqui estão três maneiras de capturar uma de suas colunas como um `Vector`: x[1], x[:A], x[:, 1] -# To grab one row as a DataFrame, we can index as follows. +# Para capturar apenas uma linha como `DataFrame`, podemos indexar assim: x[1, :] -# We can grab a single cell or element with the same syntax to grab an element of an array. +# Podemos capturar uma única célula ou elemento com a mesma sintaxe usada para capturar um elemento de uma array. x[1, 1] -# Assignment can be done in ranges to a scalar, +# Atribuição pode ser feita em intervalos para um escalar, x[1:2, 1:2] = 1 x -# to a vector of length equal to the number of assigned rows, +# ou para um vetor de comprimento igual ao número de linhas atribuídas, x[1:2, 1:2] = [1,2] x -# or to another data frame of matching size. +# ou para outro data frame de tamanho correspondente. x[1:2, 1:2] = DataFrame([5 6; 7 8]) x - From c98de7da3cc61cbd8298a3c540b462a4c2f28417 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Mon, 19 Apr 2021 14:09:02 -0300 Subject: [PATCH 09/20] some typos in 02_basicinfo.jl --- literate_notebooks/src-PT-BR/02_basicinfo.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/literate_notebooks/src-PT-BR/02_basicinfo.jl b/literate_notebooks/src-PT-BR/02_basicinfo.jl index ea07703..3a45487 100644 --- a/literate_notebooks/src-PT-BR/02_basicinfo.jl +++ b/literate_notebooks/src-PT-BR/02_basicinfo.jl @@ -3,7 +3,7 @@ # # Tradução de [Jose Storopoli](https://storopoli.io). -using DataFrames # load package +using DataFrames # carregar o pacote # ## Obtendo informações básicas sobre um data frame # From 6aa9a6a3dfeb27cb6a5ea6ed4de9a489fb668121 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Mon, 19 Apr 2021 14:09:11 -0300 Subject: [PATCH 10/20] translated 03_missingvalues.jl --- .../src-PT-BR/03_missingvalues.jl | 83 ++++++++++--------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/literate_notebooks/src-PT-BR/03_missingvalues.jl b/literate_notebooks/src-PT-BR/03_missingvalues.jl index 1e17d97..df71226 100644 --- a/literate_notebooks/src-PT-BR/03_missingvalues.jl +++ b/literate_notebooks/src-PT-BR/03_missingvalues.jl @@ -1,112 +1,113 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). -using DataFrames # load package +using DataFrames # carregar o pacote -# ## Handling missing values -# -# A singelton type `Missings.Missing` allows us to deal with missing values. +# ## Lidando com valores faltantes +# +# Um tipo de *singleton* `Missings.Missing` nos permite lidar com valores ausentes. missing, typeof(missing) -# Arrays automatically create an appropriate union type. +# As arrays criam automaticamente um tipo de união `Union` apropriado. x = [1, 2, missing, 3] -# `ismissing` checks if passed value is missing. +# `ismissing` verifica se o valor passado é faltante (`missing`). ismissing(1), ismissing(missing), ismissing(x), ismissing.(x) -# We can extract the type combined with Missing from a `Union` via -# -# (This is useful for arrays!) +# Podemos extrair o tipo combinado com `Missing` de uma `Union` por meio de +# +# (Isso é útil para matrizes!) eltype(x), Missings.T(eltype(x)) -# `missing` comparisons produce `missing`. +# comparações de `missing` produzem `missing`. missing == missing, missing != missing, missing < missing -# This is also true when `missing`s are compared with values of other types. +# Isso também ocorre quando os `missing`s são comparados com valores de outros tipos. 1 == missing, 1 != missing, 1 < missing -# `isequal`, `isless`, and `===` produce results of type `Bool`. +# `isequal`, `isless`, e `===` produzem resultado de tipo `Bool`. isequal(missing, missing), missing === missing, isequal(1, missing), isless(1, missing) -# In the next few examples, we see that many (not all) functions handle `missing`. +# Nos próximos exemplos, vemos que muitas (mas não todas) funções coseguem lidar com `missing`. -map(x -> x(missing), [sin, cos, zero, sqrt]) # part 1 +map(x -> x(missing), [sin, cos, zero, sqrt]) # parte 1 -#- +# - -map(x -> x(missing, 1), [+, - , *, /, div]) # part 2 +map(x -> x(missing, 1), [+, - , *, /, div]) # parte 2 -#- +# - -map(x -> x([1,2,missing]), [minimum, maximum, extrema, mean, any, float]) # part 3 +map(x -> x([1,2,missing]), [minimum, maximum, extrema, mean, any, float]) # parte 3 -# `skipmissing` returns iterator skipping missing values. We can use `collect` and `skipmissing` to create an array that excludes these missing values. +# `skipmissing` retorna um iterador ignorando os valores `missing`s. Podemos usar `collect` e `skipmissing` para criar um array que exclui esses valores `missing`s. collect(skipmissing([1, missing, 2, missing])) -# Similarly, here we combine `collect` and `Missings.replace` to create an array that replaces all missing values with some value (`NaN` in this case). +# Da mesma forma, aqui combinamos `collect` e `Missings.replace` para criar uma array que substitui todos os valores `missing`s por algum valor (`NaN` neste caso). collect(Missings.replace([1.0, missing, 2.0, missing], NaN)) -# Another way to do this: +# Uma outra maneira de fazer o mesmo: coalesce.([1.0, missing, 2.0, missing], NaN) -# Caution: `nothing` would also be replaced here (for Julia 0.7 a more sophisticated behavior of `coalesce` that allows to avoid this problem is planned). +# Cuidado: `nothing` também seria substituído aqui (para Julia 0.7 um comportamento mais sofisticado de `coalesce` que permite evitar este problema está planejado). coalesce.([1.0, missing, nothing, missing], NaN) -# You can use `recode` if you have homogenous output types. +# Você pode usar `recode` se tiver tipos de saída homogêneos. -recode([1.0, missing, 2.0, missing], missing=>NaN) +recode([1.0, missing, 2.0, missing], missing => NaN) -# You can use `unique` or `levels` to get unique values with or without missings, respectively. +# Você pode usar `unique` ou `levels` para obter valores únicos com ou sem `missing`s, respectivamente. unique([1, missing, 2, missing]), levels([1, missing, 2, missing]) -# In this next example, we convert `x` to `y` with `allowmissing`, where `y` has a type that accepts missings. +# No próximo exemplo, convertemos `x` em `y` com `allowmissing`, onde `y` tem um tipo que aceita `missing`s. x = [1,2,3] y = allowmissing(x) -# Then, we convert back with `disallowmissing`. This would fail if `y` contained missing values! +# Então, nós convertemos de volta com `disallowmissing`. Isso falharia se `y` contivesse valores `missing`! z = disallowmissing(y) -x,y,z +x, y, z -# In this next example, we show that the type of each column in `x` is initially `Int64`. After using `allowmissing!` to accept missing values in columns 1 and 3, the types of those columns become `Union`s of `Int64` and `Missings.Missing`. +# No próximo exemplo, mostramos que o tipo de cada coluna de `x` é inicialmente `Int64`. Depois de usar `allowmissing!` Para aceitar valores `missing`s nas colunas 1 e 3, os tipos dessas colunas se tornam `Union`s de `Int64` e `Missings.Missing`. x = DataFrame(Int, 2, 3) -println("Before: ", eltypes(x)) -allowmissing!(x, 1) # make first column accept missings -allowmissing!(x, :x3) # make :x3 column accept missings -println("After: ", eltypes(x)) +println("Antes: ", eltypes(x)) +allowmissing!(x, 1) # fazer com que a primeira coluna aceite `missing`s +allowmissing!(x, :x3) # fazer com que a coluna `:x3` aceite `missing`s +println("Depois: ", eltypes(x)) -# In this next example, we'll use `completecases` to find all the rows of a `DataFrame` that have complete data. +# Neste próximo exemplo, usaremos `completecases` para encontrar todas as linhas de um `DataFrame` que possuem dados completos. x = DataFrame(A=[1, missing, 3, 4], B=["A", "B", missing, "C"]) println(x) -println("Complete cases:\n", completecases(x)) +println("Casos completos:\n", completecases(x)) -# We can use `dropmissing` or `dropmissing!` to remove the rows with incomplete data from a `DataFrame` and either create a new `DataFrame` or mutate the original in-place. +# Podemos usar `dropmissing` ou `dropmissing!` para remover as linhas com dados incompletos de um `DataFrame` para criar um novo `DataFrame` ou modificar o original *in-place*. y = dropmissing(x) dropmissing!(x) [x, y] -# When we call `showcols` on a `DataFrame` with dropped missing values, the columns still allow missing values. +# Quando usamos `showcols` em um `DataFrame` eliminando os valores `missing`s, as colunas ainda permitem valores `missing`s. showcols(x) -# Since we've excluded missing values, we can safely use `disallowmissing!` so that the columns will no longer accept missing values. +# Uma vez que excluímos valores valores `missing`s, podemos usar com segurança `disallowmissing!` para que as colunas não aceitem mais valores `missing`s. disallowmissing!(x) showcols(x) - From 8af3066159f21ace7e8c5e57b4a2b36980cbb7cb Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Mon, 19 Apr 2021 14:29:25 -0300 Subject: [PATCH 11/20] translate 04_loadsave.jl --- literate_notebooks/src-PT-BR/04_loadsave.jl | 43 +++++++++++---------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/literate_notebooks/src-PT-BR/04_loadsave.jl b/literate_notebooks/src-PT-BR/04_loadsave.jl index d166830..eddcc35 100644 --- a/literate_notebooks/src-PT-BR/04_loadsave.jl +++ b/literate_notebooks/src-PT-BR/04_loadsave.jl @@ -1,64 +1,65 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). -using DataFrames # load package +using DataFrames # carregar o pacote -# ## Load and save DataFrames -# We do not cover all features of the packages. Please refer to their documentation to learn them. -# -# Here we'll load `CSV` to read and write CSV files and `JLD`, which allows us to work with a Julia native binary format. +# ## Carregando e Salvando DataFrames +# Não cobrimos todos os recursos dos pacotes. Consulte a documentação para aprendê-los. +# +# Aqui vamos carregar o pacote `CSV` para ler e escrever arquivos CSV e o pacote `JLD`, que nos permite trabalhar com um formato binário nativo Julia. using CSV using JLD -# Let's create a simple `DataFrame` for testing purposes, +# Vamos criar um `DataFrame` simples para fins de teste, x = DataFrame(A=[true, false, true], B=[1, 2, missing], C=[missing, "b", "c"], D=['a', missing, 'c']) -# and use `eltypes` to look at the columnwise types. +# e usar `eltypes` para ver os tipos de colunas. eltypes(x) -# Let's use `CSV` to save `x` to disk; make sure `x.csv` does not conflict with some file in your working directory. +# Vamos usar o pacote `CSV` para salvar `x` no disco; certifique-se de que `x.csv` não entre em conflito com algum arquivo em seu diretório de trabalho. CSV.write("x.csv", x) -# Now we can see how it was saved by reading `x.csv`. +# Agora podemos ver como ele foi salvo lendo `x.csv`. print(read("x.csv", String)) -# We can also load it back. `use_mmap=false` disables memory mapping so that on Windows the file can be deleted in the same session. +# Também podemos carregá-lo de volta. `use_mmap = false` desativa o mapeamento de memória para que no Windows o arquivo possa ser excluído na mesma sessão. y = CSV.read("x.csv", use_mmap=false) -# When loading in a `DataFrame` from a `CSV`, all columns allow `Missing` by default. Note that the column types have changed! +# Ao carregar em um `DataFrame` de um `CSV`, todas as colunas permitem `Missing` por padrão. Observe que os tipos de coluna mudaram! eltypes(y) -# Now let's save `x` to a file in a binary format; make sure that `x.jld` does not exist in your working directory. +# Agora vamos salvar `x` em um arquivo em formato binário; certifique-se de que `x.jld` não exista em seu diretório de trabalho. save("x.jld", "x", x) -# After loading in `x.jld` as `y`, `y` is identical to `x`. +# Depois de carregar `x.jld` como `y`, vemos que `y` é idêntico a` x`. y = load("x.jld", "x") -# Note that the column types of `y` are the same as those of `x`! +# Observe que os tipos de coluna de `y` são iguais aos de `x`! eltypes(y) -# Next, we'll create the files `bigdf.csv` and `bigdf.jld`, so be careful that you don't already have these files on disc! -# -# In particular, we'll time how long it takes us to write a `DataFrame` with 10^3 rows and 10^5 columns to `.csv` and `.jld` files. *You can expect JLD to be faster!* Use `compress=true` to reduce file sizes. +# A seguir, criaremos os arquivos `bigdf.csv` e `bigdf.jld`, então tome cuidado para que você ainda não tenha esses arquivos no disco! +# +# Em particular, vamos cronometrar quanto tempo leva para escrevermos um `DataFrame` com 10^3 linhas e 10^5 colunas para arquivos `.csv` e `.jld`. *Você pode apostar que o JLD seja mais rápido!* Use `compress = true` para reduzir o tamanho dos arquivos. bigdf = DataFrame(Bool, 10^3, 10^2) @time CSV.write("bigdf.csv", bigdf) @time save("bigdf.jld", "bigdf", bigdf) getfield.(stat.(["bigdf.csv", "bigdf.jld"]), :size) -# Finally, let's clean up. Do not run the next cell unless you are sure that it will not erase your important files. +# Finalmente, vamos fazer uma faxina geral dos arquivos que criamos. Não execute a próxima célula a menos que tenha certeza de que seus arquivos importantes não serão apagados. foreach(rm, ["x.csv", "x.jld", "bigdf.csv", "bigdf.jld"]) - From e94bfca922bfd16334e18352dddcb6afbc5628a6 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Mon, 19 Apr 2021 16:03:03 -0300 Subject: [PATCH 12/20] translated 05_columns.jl --- literate_notebooks/src-PT-BR/05_columns.jl | 129 +++++++++++---------- 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/literate_notebooks/src-PT-BR/05_columns.jl b/literate_notebooks/src-PT-BR/05_columns.jl index f32e02a..a40008e 100644 --- a/literate_notebooks/src-PT-BR/05_columns.jl +++ b/literate_notebooks/src-PT-BR/05_columns.jl @@ -1,187 +1,188 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 23, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). -using DataFrames # load package +using DataFrames # carregar o pacote -# ## Manipulating columns of DataFrame +# ## Manipulando colunas de DataFrame -#- +# - -# ### Renaming columns -# -# Let's start with a `DataFrame` of `Bool`s that has default column names. +# ### Renomeando colunas +# +# Vamos começar com um `DataFrame` de `Bool`s que tem nomes padrões de coluna. x = DataFrame(Bool, 3, 4) -# With `rename`, we create new `DataFrame`; here we rename the column `:x1` to `:A`. (`rename` also accepts collections of Pairs.) +# Com `rename`, criamos um novo `DataFrame`; aqui, renomeamos a coluna `:x1` para `:A`. (`rename` também aceita coleções de `Pairs`.) rename(x, :x1 => :A) -# With `rename!` we do an in place transformation. -# -# This time we've applied a function to every column name. +# Com `rename!` fazemos uma transformação *in-place*. +# +# Desta vez, aplicamos uma função para cada nome de coluna. rename!(c -> Symbol(string(c)^2), x) -# We can also change the name of a particular column without knowing the original. -# -# Here we change the name of the third column, creating a new `DataFrame`. +# Também podemos alterar o nome de uma coluna específica sem saber o nome original. +# +# Aqui mudamos o nome da terceira coluna, criando um novo `DataFrame`. rename(x, names(x)[3] => :third) -# With `names!`, we can change the names of all variables. +# Com `names!`, podemos mudar os nomes de todas as variáveis. names!(x, [:a, :b, :c, :d]) -# We get an error when we try to provide duplicate names +# Recebemos um erro quando tentamos fornecer nomes duplicados names!(x, fill(:a, 4)) -# unless we pass `makeunique=true`, which allows us to handle duplicates in passed names. +# a menos que passemos `makeunique = true`, o que nos permite lidar com nomes duplicados. names!(x, fill(:a, 4), makeunique=true) -# ### Reordering columns +# ### Reordenando colunas -#- +# - -# We can reorder the names(x) vector as needed, creating a new DataFrame. +# Podemos reordenar o vetor `names(x)` conforme necessário, criando um novo DataFrame. srand(1234) x[shuffle(names(x))] -# also `permutecols!` will be introduced in next release of DataFrames +# também há a possibilidade de usar `permutecols!` que será introduzido na próxima versão do DataFrames -#- +# - -# ### Merging/adding columns +# ### Mesclando/adicionando colunas -x = DataFrame([(i,j) for i in 1:3, j in 1:4]) +x = DataFrame([(i, j) for i in 1:3, j in 1:4]) -# With `hcat` we can merge two `DataFrame`s. Also [x y] syntax is supported but only when DataFrames have unique column names. +# Com `hcat` podemos fundir dois `DataFrame`s. Além disso, a sintaxe [x y] é suportada, mas apenas quando DataFrames têm nomes de coluna exclusivos (únicos). hcat(x, x, makeunique=true) -# We can also use `hcat` to add a new column; a default name `:x1` will be used for this column, so `makeunique=true` is needed. +# Também podemos usar `hcat` para adicionar uma nova coluna; um nome padrão `:x1` será usado para esta coluna, então `makeunique = true` é necessário. y = hcat(x, [1,2,3], makeunique=true) -# You can also prepend a vector with `hcat`. +# Você também pode adicionar um vetor com `hcat` antes do DataFrame. hcat([1,2,3], x, makeunique=true) -# Alternatively you could append a vector with the following syntax. This is a bit more verbose but cleaner. +# Alternativamente, você pode anexar um vetor com a seguinte sintaxe. Isso é um pouco mais verboso, mas mais elegante. y = [x DataFrame(A=[1,2,3])] -# Here we do the same but add column `:A` to the front. +# Aqui fazemos o mesmo, mas adicionamos a coluna `:A` na frente. y = [DataFrame(A=[1,2,3]) x] -# A column can also be added in the middle. Here a brute-force method is used and a new DataFrame is created. +# Uma coluna também pode ser adicionada no meio. Aqui, um método de força bruta é usado e um novo DataFrame é criado. using BenchmarkTools @btime [$x[1:2] DataFrame(A=[1,2,3]) $x[3:4]] -# We could also do this with a specialized in place method `insert!`. Let's add `:newcol` to the `DataFrame` `y`. +# Também poderíamos fazer isso com um método especializado *in-place* `insert!`. Vamos adicionar `:newcol` ao`DataFrame` `y`. insert!(y, 2, [1,2,3], :newcol) -# If you want to insert the same column name several times `makeunique=true` is needed as usual. +# Se você deseja inserir o mesmo nome de coluna várias vezes, `makeunique = true` é necessário como vocês já viram. insert!(y, 2, [1,2,3], :newcol, makeunique=true) -# We can see how much faster it is to insert a column with `insert!` than with `hcat` using `@btime`. +# Podemos ver como é muito mais rápido inserir uma coluna com `insert!` do que com `hcat` usando `@btime`. @btime insert!(copy($x), 3, [1,2,3], :A) -# Let's use `insert!` to append a column in place, +# Vamos usar `insert!` para anexar uma coluna *in-place*, -insert!(x, ncol(x)+1, [1,2,3], :A) +insert!(x, ncol(x) + 1, [1,2,3], :A) -# and to in place prepend a column. +# e também anexar *in-place* antes da coluna. insert!(x, 1, [1,2,3], :B) -# With `merge!`, let's merge the second DataFrame into first, but overwriting duplicates. +# Com `merge!`, vamos mesclar o segundo DataFrame no primeiro, mas sobrescrevendo as colunas duplicadas. df1 = DataFrame(x=1:3, y=4:6) -df2 = DataFrame(x='a':'c', z = 'd':'f', new=11:13) +df2 = DataFrame(x='a':'c', z='d':'f', new=11:13) df1, df2, merge!(df1, df2) -# For comparison: merge two `DataFrames`s but renaming duplicate names via `hcat`. +# Para comparação: mesclaremos dois `DataFrames`s, mas renomeando nomes duplicados com `hcat`. df1 = DataFrame(x=1:3, y=4:6) -df2 = DataFrame(x='a':'c', z = 'd':'f', new=11:13) +df2 = DataFrame(x='a':'c', z='d':'f', new=11:13) hcat(df1, df2, makeunique=true) -# ### Subsetting/removing columns -# -# Let's create a new `DataFrame` `x` and show a few ways to create DataFrames with a subset of `x`'s columns. +# ### Subconjunto/removendo colunas +# +# Vamos criar um novo `DataFrame` `x` e mostrar algumas maneiras de criar DataFrames com um subconjunto de colunas `x`. -x = DataFrame([(i,j) for i in 1:3, j in 1:5]) +x = DataFrame([(i, j) for i in 1:3, j in 1:5]) -# First we could do this by index +# Primeiro poderíamos fazer isso por índice x[[1,2,4,5]] -# or by column name. +# ou por nome de coluna. x[[:x1, :x4]] -# We can also choose to keep or exclude columns by `Bool`. (We need a vector whose length is the number of columns in the original `DataFrame`.) +# Também podemos escolher manter ou excluir colunas por `Bool`. (Precisamos de um vetor cujo comprimento é o número de colunas no `DataFrame` original.) x[[true, false, true, false, true]] -# Here we create a single column `DataFrame`, +# Aqui criamos um `DataFrame` com uma única coluna, x[[:x1]] -# and here we access the vector contained in column `:x1`. +# e aqui acessamos o vetor contido na coluna `:x1`. x[:x1] -# We could grab the same vector by column number +# Poderíamos acessar o mesmo vetor pelo número da coluna x[1] -# and remove everything from a `DataFrame` with `empty!`. +# e podemos remover tudo de um `DataFrame` com `empty!`. empty!(y) -# Here we create a copy of `x` and delete the 3rd column from the copy with `delete!`. +# Aqui criamos uma cópia de `x` e excluímos a 3ª coluna da cópia com `delete!`. z = copy(x) x, delete!(z, 3) -# ### Modify column by name +# ### Modificando colunas por nome -x = DataFrame([(i,j) for i in 1:3, j in 1:5]) +x = DataFrame([(i, j) for i in 1:3, j in 1:5]) -# With the following syntax, the existing column is modified without performing any copying. +# Com a seguinte sintaxe, a coluna existente é modificada sem realizar nenhuma cópia. x[:x1] = x[:x2] x -# We can also use the following syntax to add a new column at the end of a `DataFrame`. +# Também podemos usar a seguinte sintaxe para adicionar uma nova coluna no final de um `DataFrame`. x[:A] = [1,2,3] x -# A new column name will be added to our `DataFrame` with the following syntax as well (7 is equal to `ncol(x)+1`). +# Um novo nome de coluna será adicionado ao nosso `DataFrame` com a seguinte sintaxe (7 é igual a `ncol(x)+1`). x[7] = 11:13 x -# ### Find column name +# ### Achando nomes de colunas -x = DataFrame([(i,j) for i in 1:3, j in 1:5]) +x = DataFrame([(i, j) for i in 1:3, j in 1:5]) -# We can check if a column with a given name exists via +# Podemos verificar se existe uma coluna com um determinado nome via -:x1 in names(x) +:x1 in names(x) -# and determine its index via +# e determinar o seu índice com findfirst(names(x), :x2) - From 1d97dbfa43b59c0ece036294ad4f0d5ff9706833 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Mon, 19 Apr 2021 16:24:02 -0300 Subject: [PATCH 13/20] translated 06_rows.jl --- literate_notebooks/src-PT-BR/06_rows.jl | 156 ++++++++++++------------ 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/literate_notebooks/src-PT-BR/06_rows.jl b/literate_notebooks/src-PT-BR/06_rows.jl index 3660e40..d4c3334 100644 --- a/literate_notebooks/src-PT-BR/06_rows.jl +++ b/literate_notebooks/src-PT-BR/06_rows.jl @@ -1,133 +1,134 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). -using DataFrames # load package +using DataFrames # carregar o pacote srand(1); -# ## Manipulating rows of DataFrame +# ## Manipulando linhas de DataFrame -#- +# - -# ### Reordering rows +# ### Reordenando linhas -x = DataFrame(id=1:10, x = rand(10), y = [zeros(5); ones(5)]) # and we hope that x[:x] is not sorted :) +x = DataFrame(id=1:10, x=rand(10), y=[zeros(5); ones(5)]) # we esperamos x[:x] não esteja já ordenado :) -#- +# - -issorted(x), issorted(x, :x) # check if a DataFrame or a subset of its columns is sorted +issorted(x), issorted(x, :x) # verifica se um DataFrame ou um subconjunto das suas colunas está ordenado -#- +# - -sort!(x, :x) # sort x in place +sort!(x, :x) # ordena x *in-place* -#- +# - -y = sort(x, :id) # new DataFrame +y = sort(x, :id) # novo DataFrame -#- +# - -sort(x, (:y, :x), rev=(true, false)) # sort by two columns, first is decreasing, second is increasing +sort(x, (:y, :x), rev=(true, false)) # ordena por duas columnas, primeira é de maneira descrescente, segunda é de maneira crescente -#- +# - -sort(x, (order(:y, rev=true), :x)) # the same as above +sort(x, (order(:y, rev=true), :x)) # o mesmo que acima -#- +# - -sort(x, (order(:y, rev=true), order(:x, by=v->-v))) # some more fancy sorting stuff +sort(x, (order(:y, rev=true), order(:x, by=v -> -v))) # mais uma maneira elegante de ordenar -#- +# - -x[shuffle(1:10), :] # reorder rows (here randomly) +x[shuffle(1:10), :] # reordena linhas (agora de maneira aleatória) -#- +# - sort!(x, :id) -x[[1,10],:] = x[[10,1],:] # swap rows +x[[1,10],:] = x[[10,1],:] # trocar linhas x -#- +# - -x[1,:], x[10,:] = x[10,:], x[1,:] # and swap again +x[1,:], x[10,:] = x[10,:], x[1,:] # mais uma troca x -# ### Merging/adding rows +# ### Mesclando/adicionando linhas x = DataFrame(rand(3, 5)) -#- +# - -[x; x] # merge by rows - data frames must have the same column names; the same is vcat +[x; x] # mesclar por linhas - os data frames devem ter os mesmos nomes de colunas; assim como vcat -#- +# - -y = x[reverse(names(x))] # get y with other order of names +y = x[reverse(names(x))] # obtenha y com outra ordenação de nomes de colunas -#- +# - -vcat(x, y) # we get what we want as vcat does column name matching +vcat(x, y) # nós conseguimos o que queremos, pois o vcat faz a correspondência dos nomes das colunas -#- +# - -vcat(x, y[1:3]) # but column names must still match +vcat(x, y[1:3]) # mas os nomes das colunas ainda devem corresponder -#- +# - -append!(x, x) # the same but modifies x +append!(x, x) # o mesmo mas modifica x *in-place* -#- +# - -append!(x, y) # here column names must match exactly +append!(x, y) # aqui os nomes das colunas devem corresponder exatamente -#- - -push!(x, 1:5) # add one row to x at the end; must give correct number of values and correct types +# - +push!(x, 1:5) # # adicione uma linha a x no final; deve fornecer o número correto de valores assim como os tipos corretos x -#- +# - -push!(x, Dict(:x1=> 11, :x2=> 12, :x3=> 13, :x4=> 14, :x5=> 15)) # also works with dictionaries +push!(x, Dict(:x1 => 11, :x2 => 12, :x3 => 13, :x4 => 14, :x5 => 15)) # também funciona com dicionários x -# ### Subsetting/removing rows +# ### Subconjunto/removendo linhas x = DataFrame(id=1:10, val='a':'j') -#- +# - -x[1:2, :] # by index +x[1:2, :] # por índice -#- +# - -view(x, 1:2) # the same but a view +view(x, 1:2) # o mesmo mas uma *view* -#- +# - -x[repmat([true, false], 5), :] # by Bool, exact length required +x[repmat([true, false], 5), :] # por `Bool`, requer comprimento exato -#- +# - -view(x, repmat([true, false], 5), :) # view again +view(x, repmat([true, false], 5), :) # *view* de novo -#- +# - -deleterows!(x, 7) # delete one row +deleterows!(x, 7) # deleta uma linha -#- +# - -deleterows!(x, 6:7) # delete a collection of rows +deleterows!(x, 6:7) # deleta uma coleção de linhas -#- +# - x = DataFrame([1:4, 2:5, 3:6]) -#- +# - -filter(r -> r[:x1] > 2.5, x) # create a new DataFrame where filtering function operates on DataFrameRow +filter(r -> r[:x1] > 2.5, x) # crie um novo DataFrame onde a função de filtragem opera em `DataFrameRow` -#- +# - -## in place modification of x, an example with do-block syntax +## modificação *in-place* de x, um exemplo com uma sintaxe de bloco `do` filter!(x) do r if r[:x1] > 2.5 return r[:x2] < 4.5 @@ -135,43 +136,42 @@ filter!(x) do r r[:x3] < 3.5 end -# ### Deduplicating +# ### "Desduplicando" x = DataFrame(A=[1,2], B=["x","y"]) append!(x, x) x[:C] = 1:4 x -#- +# - -unique(x, [1,2]) # get first unique rows for given index +unique(x, [1,2]) # obtém as primeiras linhas únicas para determinado índice -#- +# - -unique(x) # now we look at whole rows +unique(x) # agora considerando todas as linhas -#- +# - -nonunique(x, :A) # get indicators of non-unique rows +nonunique(x, :A) # obtém indicadores de linhas não-únicas -#- +# - -unique!(x, :B) # modify x in place +unique!(x, :B) # modifica x *in-place* -# ### Extracting one row from `DataFrame` into a vector +# ### Extraíndo uma linha do `DataFrame` em um vetor x = DataFrame(x=[1,missing,2], y=["a", "b", missing], z=[true,false,true]) -#- +# - cols = [:x, :y] -[x[1, col] for col in cols] # subset of columns - -#- +[x[1, col] for col in cols] # subconjunto de colunas -[[x[i, col] for col in names(x)] for i in 1:nrow(x)] # vector of vectors, each entry contains one full row of x +# - -#- +[[x[i, col] for col in names(x)] for i in 1:nrow(x)] # vetor de vetores, cada elemento contém uma linha completa de x -Tuple(x[1, col] for col in cols) # similar construct for Tuples, when ported to Julia 0.7 NamedTuples will be added +# - +Tuple(x[1, col] for col in cols) # construtor similar para Tuplas, quando portado para Julia 0.7 NamedTuples (Tupla Nomeada) será adicionada From 32dda707a3458d45ec21a1e0a19a7159961b243b Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Tue, 20 Apr 2021 12:02:36 -0300 Subject: [PATCH 14/20] translated 07_factors.jl --- literate_notebooks/src-PT-BR/07_factors.jl | 215 +++++++++++---------- 1 file changed, 108 insertions(+), 107 deletions(-) diff --git a/literate_notebooks/src-PT-BR/07_factors.jl b/literate_notebooks/src-PT-BR/07_factors.jl index a3ff03c..78b7c5d 100644 --- a/literate_notebooks/src-PT-BR/07_factors.jl +++ b/literate_notebooks/src-PT-BR/07_factors.jl @@ -1,231 +1,232 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). -using DataFrames # load package +using DataFrames # carregar o pacote -# ## Working with CategoricalArrays +# ## Trabalhando com CategoricalArrays (Matrizes Categóricas) -#- +# - -# ### Constructor +# ### Construtor -x = categorical(["A", "B", "B", "C"]) # unordered +x = categorical(["A", "B", "B", "C"]) # não-ordenado -#- +# - -y = categorical(["A", "B", "B", "C"], ordered=true) # ordered, by default order is sorting order +y = categorical(["A", "B", "B", "C"], ordered=true) # ordenado, por padrão por padrão, a ordem é a ordem de classificação -#- +# - -z = categorical(["A","B","B","C", missing]) # unordered with missings +z = categorical(["A","B","B","C", missing]) # não-ordenado com `missing`s -#- +# - -c = cut(1:10, 5) # ordered, into equal counts, possible to rename labels and give custom breaks +c = cut(1:10, 5) # ordenados, em contagens iguais, é possível renomear rótulos e personalizar os cortes (breaks) -#- +# - -by(DataFrame(x=cut(randn(100000), 10)), :x, d -> DataFrame(n=nrow(d)), sort=true) # just to make sure it works right +by(DataFrame(x=cut(randn(100000), 10)), :x, d -> DataFrame(n=nrow(d)), sort=true) # apenas para ter certeza de que funciona bem -#- +# - -v = categorical([1,2,2,3,3]) # contains integers not strings +v = categorical([1,2,2,3,3]) # contém inteiros, não strings -#- +# - -Vector{Union{String, Missing}}(z) # sometimes you need to convert back to a standard vector +Vector{Union{String,Missing}}(z) # às vezes você precisa converter de volta para um vetor padrão -# ### Managing levels +# ### Manipulando níveis arr = [x,y,z,c,v] -#- +# - -isordered.(arr) # chcek if categorical array is orderd +isordered.(arr) # verifique se a array categórica está ordenada -#- +# - -ordered!(x, true), isordered(x) # make x ordered +ordered!(x, true), isordered(x) # faça x ser ordenado -#- +# - -ordered!(x, false), isordered(x) # and unordered again +ordered!(x, false), isordered(x) # e não-ordenado novamente -#- +# - -levels.(arr) # list levels +levels.(arr) # liste os níveis -#- +# - -unique.(arr) # missing will be included +unique.(arr) # `missing`s serão incluídos -#- +# - -y[1] < y[2] # can compare as y is ordered +y[1] < y[2] # pode comparar enquanto y for ordenado -#- +# - -v[1] < v[2] # not comparable, v is unordered although it contains integers +v[1] < v[2] # não comparável, v não está ordenado, embora contenha inteiros -#- +# - -levels!(y, ["C", "B", "A"]) # you can reorder levels, mostly useful for ordered CategoricalArrays +levels!(y, ["C", "B", "A"]) # você pode reordenar os níveis, principalmente útil para CategoricalArrays ordenadas -#- +# - -y[1] < y[2] # observe that the order is changed +y[1] < y[2] # observe que a ordem é alterada -#- +# - -levels!(z, ["A", "B"]) # you have to specify all levels that are present +levels!(z, ["A", "B"]) # você tem que especificar todos os níveis que estão presentes -#- +# - -levels!(z, ["A", "B"], allow_missing=true) # unless the underlying array allows for missings and force removal of levels +levels!(z, ["A", "B"], allow_missing=true) # a menos que a array subjacente permita `missing`s e faça uma remoção forçada de níveis -#- +# - z[1] = "B" -z # now z has only "B" entries +z # agora z somente tem elementos "B" -#- +# - -levels(z) # but it remembers the levels it had (the reason is mostly performance) +levels(z) # mas lembra os níveis que tinha (o motivo é principalmente o desempenho) -#- +# - -droplevels!(z) # this way we can clean it up +droplevels!(z) # desta forma podemos limpá-lo levels(z) -# ### Data manipulation +# ### Manipulação de dados x, levels(x) -#- +# - x[2] = "0" -x, levels(x) # new level added at the end (works only for unordered) +x, levels(x) # novo nível adicionado ao fim (funciona apenas para não-ordenados) -#- +# - v, levels(v) -#- +# - -v[1] + v[2] # even though underlying data is Int, we cannot operate on it +v[1] + v[2] # mesmo que os dados subjacentes sejam Int, não podemos operar sobre eles -#- +# - -Vector{Int}(v) # you have either to retrieve the data by conversion (may be expensive) +Vector{Int}(v) # você deve recuperar os dados por conversão (pode ser caro) -#- +# - -get(v[1]) + get(v[2]) # or get a single value +get(v[1]) + get(v[2]) # ou obter um único valor -#- +# - -get.(v) # this will work for arrays witout missings +get.(v) # isso funcionará para arrays sem `missing`s -#- +# - -get.(z) # but will fail on missing values +get.(z) # mas falhará na presença valores `missing`s -#- +# - -Vector{Union{String, Missing}}(z) # you have to do the conversion +Vector{Union{String,Missing}}(z) # você tem que converter -#- +# - -z[1]*z[2], z.^2 # the only exception are CategoricalArrays based on String - you can operate on them normally +z[1] * z[2], z.^2 # a única exceção são as CategoricalArrays baseados em String - você pode operá-las normalmente -#- +# - -recode([1,2,3,4,5,missing], 1=>10) # recode some values in an array; has also in place recode! equivalent +recode([1,2,3,4,5,missing], 1 => 10) # recodifique alguns valores de uma array; também possível fazer o equivalente *in-place* com recode! -#- +# - -recode([1,2,3,4,5,missing], "a", 1=>10, 2=>20) # here we provided a default value for not mapped recodings +recode([1,2,3,4,5,missing], "a", 1 => 10, 2 => 20) # aqui, fornecemos um valor padrão para recodificações não mapeadas -#- +# - -recode([1,2,3,4,5,missing], 1=>10, missing=>"missing") # to recode Missing you have to do it explicitly +recode([1,2,3,4,5,missing], 1 => 10, missing => "missing") # para recodificar `missing` você tem que fazer de maneira explícita -#- +# - t = categorical([1:5; missing]) t, levels(t) -#- +# - -recode!(t, [1,3]=>2) -t, levels(t) # note that the levels are dropped after recode +recode!(t, [1,3] => 2) +t, levels(t) # note que os níveis não são removidos após a recodificação -#- +# - t = categorical([1,2,3], ordered=true) -levels(recode(t, 2=>0, 1=>-1)) # and if you introduce a new levels they are added at the end in the order of appearance +levels(recode(t, 2 => 0, 1 => -1)) # e se você introduzir novos níveis, eles serão adicionados no final na ordem de surgimento -#- +# - -t = categorical([1,2,3,4,5], ordered=true) # when using default it becomes the last level -levels(recode(t, 300, [1,2]=>100, 3=>200)) +t = categorical([1,2,3,4,5], ordered=true) # ao usar o padrão, ele se torna o último nível +levels(recode(t, 300, [1,2] => 100, 3 => 200)) -# ### Comparisons +# ### Comparações x = categorical([1,2,3]) xs = [x, categorical(x), categorical(x, ordered=true), categorical(x, ordered=true)] levels!(xs[2], [3,2,1]) levels!(xs[4], [2,3,1]) -[a == b for a in xs, b in xs] # all are equal - comparison only by contents +[a == b for a in xs, b in xs] # todas são iguais - compara apenas os conteúdos -#- +# - -signature(x::CategoricalArray) = (x, levels(x), isordered(x)) # this is actually the full signature of CategoricalArray -## all are different, notice that x[1] and x[2] are unordered but have a different order of levels +signature(x::CategoricalArray) = (x, levels(x), isordered(x)) # esta é na verdade a assinatura completa de CategoricalArray +## todos são diferentes, observe que x [1] e x [2] não estão ordenados, mas têm uma ordem diferente de níveis [signature(a) == signature(b) for a in xs, b in xs] -#- +# - -x[1] < x[2] # you cannot compare elements of unordered CategoricalArray +x[1] < x[2] # você não pode comparar elementos de CategoricalArray não-ordenada -#- +# - -t[1] < t[2] # but you can do it for an ordered one +t[1] < t[2] # mas você pode fazer isso em uma ordenada -#- +# - -isless(x[1], x[2]) # isless works within the same CategoricalArray even if it is not ordered +isless(x[1], x[2]) # isless funciona dentro da mesma CategoricalArray, mesmo que não esteja ordenada -#- +# - -y = deepcopy(x) # but not across categorical arrays +y = deepcopy(x) # mas não entre CategoricalArrays isless(x[1], y[2]) -#- +# - -isless(get(x[1]), get(y[2])) # you can use get to make a comparison of the contents of CategoricalArray +isless(get(x[1]), get(y[2])) # você pode usar get para fazer uma comparação do conteúdo de CategoricalArray -#- +# - -x[1] == y[2] # equality tests works OK across CategoricalArrays +x[1] == y[2] # os testes de igualdade funcionam OK em CategoricalArrays -# ### Categorical columns in a DataFrame +# ### Colunas categóricas em um DataFrame -df = DataFrame(x = 1:3, y = 'a':'c', z = ["a","b","c"]) +df = DataFrame(x=1:3, y='a':'c', z=["a","b","c"]) -#- +# - -categorical!(df) # converts all eltype(AbstractString) columns to categorical +categorical!(df) # converte todas colunas eltype(AbstractString) para categótica -#- +# - showcols(df) -#- +# - -categorical!(df, :x) # manually convert to categorical column :x +categorical!(df, :x) # conversão manual da coluna :x em categórica -#- +# - showcols(df) - From 28618227b45992d21afb322b55c7ff1f6b4a56e8 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Tue, 20 Apr 2021 12:12:07 -0300 Subject: [PATCH 15/20] translated 08_joins.jl --- literate_notebooks/src-PT-BR/08_joins.jl | 69 ++++++++++++------------ 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/literate_notebooks/src-PT-BR/08_joins.jl b/literate_notebooks/src-PT-BR/08_joins.jl index e52bc22..626259f 100644 --- a/literate_notebooks/src-PT-BR/08_joins.jl +++ b/literate_notebooks/src-PT-BR/08_joins.jl @@ -1,76 +1,77 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2017** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). -using DataFrames # load package +using DataFrames # carregar o pacote -# ## Joining DataFrames +# ## Juntando (*join*) DataFrames -#- +# - -# ### Preparing DataFrames for a join +# ### Preparando DataFrames para um *join* -x = DataFrame(ID=[1,2,3,4,missing], name = ["Alice", "Bob", "Conor", "Dave","Zed"]) -y = DataFrame(id=[1,2,5,6,missing], age = [21,22,23,24,99]) -x,y +x = DataFrame(ID=[1,2,3,4,missing], name=["Alice", "Bob", "Conor", "Dave","Zed"]) +y = DataFrame(id=[1,2,5,6,missing], age=[21,22,23,24,99]) +x, y -#- +# - -rename!(x, :ID=>:id) # names of columns on which we want to join must be the same +rename!(x, :ID => :id) # os nomes das colunas nas quais queremos dar *join* devem ser os mesmos -# ### Standard joins: inner, left, right, outer, semi, anti +# ### *Joins* padrões: *inner*, *left*, *right*, *outer*, *semi*, *anti* -join(x, y, on=:id) # :inner join by default, missing is joined +join(x, y, on=:id) # :inner *join* por padrão, `missing`s são considerados -#- +# - join(x, y, on=:id, kind=:left) -#- +# - join(x, y, on=:id, kind=:right) -#- +# - join(x, y, on=:id, kind=:outer) -#- +# - join(x, y, on=:id, kind=:semi) -#- +# - join(x, y, on=:id, kind=:anti) -# ### Cross join +# ### *Cross-join* -## cross-join does not require on argument -## it produces a Cartesian product or arguments -function expand_grid(;xs...) # a simple replacement for expand.grid in R - reduce((x,y) -> join(x, DataFrame(Pair(y...)), kind=:cross), +## *cross-join* não requer argumentos +## pois produz um produto Cartesiano +function expand_grid(;xs...) # uma substituição simples do expand.grid em R + reduce((x, y) -> join(x, DataFrame(Pair(y...)), kind=:cross), DataFrame(Pair(xs[1]...)), xs[2:end]) end expand_grid(a=[1,2], b=["a","b","c"], c=[true,false]) -# ### Complex cases of joins +# ### Casos complexos de *joins* x = DataFrame(id1=[1,1,2,2,missing,missing], id2=[1,11,2,21,missing,99], - name = ["Alice", "Bob", "Conor", "Dave","Zed", "Zoe"]) + name=["Alice", "Bob", "Conor", "Dave","Zed", "Zoe"]) y = DataFrame(id1=[1,1,3,3,missing,missing], id2=[11,1,31,3,missing,999], - age = [21,22,23,24,99, 100]) -x,y + age=[21,22,23,24,99, 100]) +x, y -#- +# - -join(x, y, on=[:id1, :id2]) # joining on two columns +join(x, y, on=[:id1, :id2]) # *join* em duas colunas -#- +# - -join(x, y, on=[:id1], makeunique=true) # with duplicates all combinations are produced (here :inner join) +join(x, y, on=[:id1], makeunique=true) # com duplicados, todas as combinações são produzidas (aqui :inner *join*) -#- - -join(x, y, on=[:id1], kind=:semi) # but not by :semi join (as it would duplicate rows) +# - +join(x, y, on=[:id1], kind=:semi) # o que não ocorre em :semi *join* (pois duplicaria linhas) From 87bc36b124cb83d694dfb9ce0b1fdea988ecb4e7 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Tue, 20 Apr 2021 12:20:25 -0300 Subject: [PATCH 16/20] translated 09_reshaping.jl --- literate_notebooks/src-PT-BR/09_reshaping.jl | 81 ++++++++++---------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/literate_notebooks/src-PT-BR/09_reshaping.jl b/literate_notebooks/src-PT-BR/09_reshaping.jl index d6ec25b..c1178d1 100644 --- a/literate_notebooks/src-PT-BR/09_reshaping.jl +++ b/literate_notebooks/src-PT-BR/09_reshaping.jl @@ -1,90 +1,91 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). -using DataFrames # load package +using DataFrames # carregar o pacote -# ## Reshaping DataFrames +# ## Redimensionando DataFrames -#- +# - -# ### Wide to long +# ### Amplo (*wide*) para comprido (*long*) x = DataFrame(id=[1,2,3,4], id2=[1,1,2,2], M1=[11,12,13,14], M2=[111,112,113,114]) -#- +# - -melt(x, :id, [:M1, :M2]) # first pass id-variables and then measure variables; meltdf makes a view +melt(x, :id, [:M1, :M2]) # primeiro passe variáveis de identificação (id ou chaves) e então as variáveis de mensuração; meltdf produz uma view -#- +# - -## optionally you can rename columns; melt and stack are identical but order of arguments is reversed -stack(x, [:M1, :M2], :id, variable_name=:key, value_name=:observed) # first measures and then id-s; stackdf creates view +## opcionalmente você pode renomear colunas; melt e stack são idênticos mas a ordem dos argumentos é invertida +stack(x, [:M1, :M2], :id, variable_name=:key, value_name=:observed) # primeiro mensurações depois as id's; stackdf produz uma view -#- +# - -## if second argument is omitted in melt or stack , all other columns are assumed to be the second argument -## but measure variables are selected only if they are <: AbstractFloat +## se o segundo argumento for omitido em melt ou stack, todas as outras colunas serão consideradas como o segundo argumento +## mas as variáveis de mensuração são selecionadas apenas se forem <: AbstractFloat melt(x, [:id, :id2]) -#- +# - -melt(x, [1, 2]) # you can use index instead of symbol +melt(x, [1, 2]) # você pode usar o índice ao invés do símbolo -#- +# - -bigx = DataFrame(rand(10^6, 10)) # a test comparing creation of new DataFrame and a view +bigx = DataFrame(rand(10^6, 10)) # um teste comparando a criação de um novo DataFrame e uma view bigx[:id] = 1:10^6 @time melt(bigx, :id) @time melt(bigx, :id) @time meltdf(bigx, :id) @time meltdf(bigx, :id); -#- +# - -x = DataFrame(id = [1,1,1], id2=['a','b','c'], a1 = rand(3), a2 = rand(3)) +x = DataFrame(id=[1,1,1], id2=['a','b','c'], a1=rand(3), a2=rand(3)) -#- +# - melt(x) -#- +# - -melt(DataFrame(rand(3,2))) # by default stack and melt treats floats as value columns +melt(DataFrame(rand(3, 2))) # por padrão stack e melt trata floats como colunas de valores -#- +# - -df = DataFrame(rand(3,2)) +df = DataFrame(rand(3, 2)) df[:key] = [1,1,1] -mdf = melt(df) # duplicates in key are silently accepted +mdf = melt(df) # duplicados nas chaves são silenciosamente aceitos -# ### Long to wide +# ### Comprodido(*long*) para amplo (*wide*) -x = DataFrame(id = [1,1,1], id2=['a','b','c'], a1 = rand(3), a2 = rand(3)) +x = DataFrame(id=[1,1,1], id2=['a','b','c'], a1=rand(3), a2=rand(3)) -#- +# - y = melt(x, [1,2]) display(x) display(y) -#- +# - -unstack(y, :id2, :variable, :value) # stndard unstack with a unique key +unstack(y, :id2, :variable, :value) # unstack padrão com chave única -#- +# - -unstack(y, :variable, :value) # all other columns are treated as keys +unstack(y, :variable, :value) # todas as outras colunas são tratadas como chaves -#- +# - -## by default :id, :variable and :value names are assumed; in this case it produces duplicate keys +## por padrão nomes como :id, :variable e :value são presumidos; neste caso, produz chaves duplicadas unstack(y) -#- +# - -df = stack(DataFrame(rand(3,2))) +df = stack(DataFrame(rand(3, 2))) -#- - -unstack(df, :variable, :value) # unable to unstack when no key column is present +# - +unstack(df, :variable, :value) # não é possível fazer unstack quando não há coluna key presente From 54d8acd4c8138b5bc826973ff49a02168e33bc99 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Tue, 20 Apr 2021 12:31:28 -0300 Subject: [PATCH 17/20] translated 10_transforms.jl --- literate_notebooks/src-PT-BR/10_transforms.jl | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/literate_notebooks/src-PT-BR/10_transforms.jl b/literate_notebooks/src-PT-BR/10_transforms.jl index 3b5b4aa..b796d0d 100644 --- a/literate_notebooks/src-PT-BR/10_transforms.jl +++ b/literate_notebooks/src-PT-BR/10_transforms.jl @@ -1,80 +1,81 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). -using DataFrames # load package +using DataFrames # carregar o pacote -# ## Split-apply-combine +# ## Transformações - *Split*-*apply*-*combine* x = DataFrame(id=[1,2,3,4,1,2,3,4], id2=[1,2,1,2,1,2,1,2], v=rand(8)) -#- +# - gx1 = groupby(x, :id) -#- +# - gx2 = groupby(x, [:id, :id2]) -#- +# - -vcat(gx2...) # back to the original DataFrame +vcat(gx2...) # de volta para o DataFrame original -#- +# - -x = DataFrame(id = [missing, 5, 1, 3, missing], x = 1:5) +x = DataFrame(id=[missing, 5, 1, 3, missing], x=1:5) -#- +# - -showall(groupby(x, :id)) # by default groups include mising values and are not sorted +showall(groupby(x, :id)) # por padrão grupos incluem `missing`s e não são ordenados -#- +# - -showall(groupby(x, :id, sort=true, skipmissing=true)) # but we can change it :) +showall(groupby(x, :id, sort=true, skipmissing=true)) # mas podemos mudar isso :) -#- +# - x = DataFrame(id=rand('a':'d', 100), v=rand(100)); -by(x, :id, y->mean(y[:v])) # apply a function to each group of a data frame +by(x, :id, y -> mean(y[:v])) # aplicar uma função para cada grupo de um data frame -#- +# - -by(x, :id, y->mean(y[:v]), sort=true) # we can sort the output +by(x, :id, y -> mean(y[:v]), sort=true) # também podemos ordenar o resultado -#- +# - -by(x, :id, y->DataFrame(res=mean(y[:v]))) # this way we can set a name for a column - DataFramesMeta @by is better +by(x, :id, y -> DataFrame(res=mean(y[:v]))) # assim também é possível designar um nome para a coluna - o @by do DataFramesMeta é uma melhor opção -#- +# - x = DataFrame(id=rand('a':'d', 100), x1=rand(100), x2=rand(100)) -aggregate(x, :id, sum) # apply a function over all columns of a data frame in groups given by id +aggregate(x, :id, sum) # aplique uma função sobre todas as colunas de um data frame nos grupos dados por uma id -#- +# - aggregate(x, :id, sum, sort=true) # also can be sorted -# *We omit the discussion of of map/combine as I do not find them very useful (better to use by)* +# *Omitimos a discussão de map/combine, pois não considero muito úteis (melhor usar by)* x = DataFrame(rand(3, 5)) -#- +# - -map(mean, eachcol(x)) # map a function over each column and return a data frame +map(mean, eachcol(x)) # aplique uma função em cada coluna e retorne um data frame -#- +# - -foreach(c -> println(c[1], ": ", mean(c[2])), eachcol(x)) # a raw iteration returns a tuple with column name and values +foreach(c -> println(c[1], ": ", mean(c[2])), eachcol(x)) # uma iteração bruta retorna uma tupla com o nome da coluna e valores -#- +# - -colwise(mean, x) # colwise is similar, but produces a vector +colwise(mean, x) # colwise é similar, mas produz um vector -#- +# - x[:id] = [1,1,2] -colwise(mean,groupby(x, :id)) # and works on GroupedDataFrame +colwise(mean,groupby(x, :id)) # e funciona em GroupedDataFrame -#- - -map(r -> r[:x1]/r[:x2], eachrow(x)) # now the returned value is DataFrameRow which works similarly to a one-row DataFrame +# - +map(r -> r[:x1] / r[:x2], eachrow(x)) # agora o valor retornado é DataFrameRow, que funciona de forma semelhante a um DataFrame de uma linha só From 99665c67eb0a0fb0b849f04f415b647ecd4937f1 Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Tue, 20 Apr 2021 12:39:00 -0300 Subject: [PATCH 18/20] translated 11_performance.jl --- .../src-PT-BR/11_performance.jl | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/literate_notebooks/src-PT-BR/11_performance.jl b/literate_notebooks/src-PT-BR/11_performance.jl index 005e877..b204618 100644 --- a/literate_notebooks/src-PT-BR/11_performance.jl +++ b/literate_notebooks/src-PT-BR/11_performance.jl @@ -1,81 +1,83 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). using DataFrames using BenchmarkTools -# ## Performance tips +# ## Dicas de desempenho -#- +# - -# ### Access by column number is faster than by name +# ### O acesso por número de coluna é mais rápido do que por nome x = DataFrame(rand(5, 1000)) @btime x[500]; @btime x[:x500]; -# ### When working with data `DataFrame` use barrier functions or type annotation +# ### Ao trabalhar com dados `DataFrame`, use funções de barreira ou anotação de tipo -function f_bad() # this function will be slow - srand(1); x = DataFrame(rand(1000000,2)) +function f_bad() # essa função será lenta + srand(1); x = DataFrame(rand(1000000, 2)) y, z = x[1], x[2] p = 0.0 for i in 1:nrow(x) - p += y[i]*z[i] + p += y[i] * z[i] end p end @btime f_bad(); -#- +# - -@code_warntype f_bad() # the reason is that Julia does not know the types of columns in `DataFrame` +@code_warntype f_bad() # a razão é que Julia não conhece os tipos de colunas no `DataFrame` -#- +# - -## solution 1 is to use barrier function (it should be possible to use it in almost any code) -function f_inner(y,z) - p = 0.0 - for i in 1:length(y) - p += y[i]*z[i] - end - p +## a solução 1 é usar a função de barreira (deve ser possível usá-la em quase qualquer código) +function f_inner(y, z) + p = 0.0 + for i in 1:length(y) + p += y[i] * z[i] + end + p end -function f_barrier() # extract the work to an inner function - srand(1); x = DataFrame(rand(1000000,2)) +function f_barrier() # extrair o trabalho para uma função interna + srand(1); x = DataFrame(rand(1000000, 2)) f_inner(x[1], x[2]) end -function f_inbuilt() # or use inbuilt function if possible - srand(1); x = DataFrame(rand(1000000,2)) +function f_inbuilt() # ou use a função embutida, se possível + srand(1); x = DataFrame(rand(1000000, 2)) dot(x[1], x[2]) end @btime f_barrier(); @btime f_inbuilt(); -#- +# - -## solution 2 is to provide the types of extracted columns -## it is simpler but there are cases in which you will not know these types +## a solução 2 é fornecer os tipos de colunas extraídas +## é mais simples, mas há casos em que você não conhecerá esses tipos function f_typed() - srand(1); x = DataFrame(rand(1000000,2)) + srand(1); x = DataFrame(rand(1000000, 2)) y::Vector{Float64}, z::Vector{Float64} = x[1], x[2] p = 0.0 for i in 1:nrow(x) - p += y[i]*z[i] + p += y[i] * z[i] end p end @btime f_typed(); -# ### Consider using delayed `DataFrame` creation technique +# ### Considere usar uma técnica de criação de `DataFrame` "atrasada" function f1() - x = DataFrame(Float64, 10^4, 100) # we work with DataFrame directly + x = DataFrame(Float64, 10^4, 100) # trabalhamos com DataFrame diretamente for c in 1:ncol(x) d = x[c] for r in 1:nrow(x) @@ -94,29 +96,29 @@ function f2() end x[c] = d end - DataFrame(x) # we delay creation of DataFrame after we have our job done + DataFrame(x) # atrasamos a criação do DataFrame somente depois de terminarmos nosso trabalho end @btime f1(); @btime f2(); -# ### You can add rows to a `DataFrame` in place and it is fast +# ### Você pode adicionar linhas a um `DataFrame` de maneira *in-place* e é rápido x = DataFrame(rand(10^6, 5)) y = DataFrame(transpose(1.0:5.0)) z = [1.0:5.0;] -@btime vcat($x, $y); # creates a new DataFrame - slow -@btime append!($x, $y); # in place - fast +@btime vcat($x, $y); # cria um novo DataFrame - lento +@btime append!($x, $y); # *in-place* - rápido -x = DataFrame(rand(10^6, 5)) # reset to the same starting point -@btime push!($x, $z); # add a single row in place - fastest +x = DataFrame(rand(10^6, 5)) # redefinir para o mesmo ponto de partida +@btime push!($x, $z); # adiciona uma única linha *in-place* - o mais rápido -# ### Allowing `missing` as well as `categorical` slows down computations +# ### Permitindo `missing`s assim como `categorical`s reduz o desempenho using StatsBase -function test(data) # uses countmap function to test performance +function test(data) # usa a função countmap para testar desempenho println(eltype(data)) x = rand(data, 10^6) y = categorical(x) @@ -131,5 +133,3 @@ test(1:10) test([randstring() for i in 1:10]) test(allowmissing(1:10)) test(allowmissing([randstring() for i in 1:10])) - - From 1409b6cab6716334a67bfefd34ca1f4c5750fc5e Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Tue, 20 Apr 2021 12:44:06 -0300 Subject: [PATCH 19/20] translated 12_pitfalls.jl --- literate_notebooks/src-PT-BR/12_pitfalls.jl | 63 +++++++++++---------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/literate_notebooks/src-PT-BR/12_pitfalls.jl b/literate_notebooks/src-PT-BR/12_pitfalls.jl index 8eb5e79..764ac15 100644 --- a/literate_notebooks/src-PT-BR/12_pitfalls.jl +++ b/literate_notebooks/src-PT-BR/12_pitfalls.jl @@ -1,73 +1,74 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), Apr 21, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). using DataFrames -# ## Possible pitfalls +# ## Possíveis armadilhas -#- +# - -# ### Know what is copied when creating a `DataFrame` +# ### Saiba o que é copiado ao criar um `DataFrame` x = DataFrame(rand(3, 5)) -#- +# - y = DataFrame(x) -x === y # no copyinng performed +x === y # nenhuma cópia realizada -#- +# - y = copy(x) -x === y # not the same object +x === y # não é o mesmo 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)) # mas as colunas são as mesmas -#- +# - -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) # o mesmo ao criar arrays ou atribuir colunas, exceto ranges -#- +# - -y === df[:y] # the same object +y === df[:y] # o mesmo objeto -#- +# - -typeof(x), typeof(df[:x]) # range is converted to a vector +typeof(x), typeof(df[:x]) # range é convertido para vetor -# ### Do not modify the parent of `GroupedDataFrame` +# ### Não modifique o "pai" de um `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 +x[1:3, 1] = [2,2,2] +g # bem - está errado agora, g é apenas uma view -# ### Remember that you can filter columns of a `DataFrame` using booleans +# ### Lembre-se de que você pode filtrar colunas de um `DataFrame` usando booleanos 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] # bem - filtramos colunas, não linhas por acidente, pois você pode selecionar colunas usando booleanos -#- +# - -x[x[:x1] .< 0.25, :] # probably this is what we wanted +x[x[:x1] .< 0.25, :] # provavelmente isso é o que queríamos -# ### Column selection for DataFrame creates aliases unless explicitly copied +# ### Cseleção de coluna para DataFrame cria aliases, a menos que explicitamente copiado 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] # também alias +x[:d] = x[1][:] # cópia +x[:e] = copy(x[1]) # cópia explícita display(x) x[1,1] = 100 display(x) - From c7bd6743aa6a613c7e63c16bc06de73263da33de Mon Sep 17 00:00:00 2001 From: Jose Eduardo Storopoli Date: Tue, 20 Apr 2021 12:58:23 -0300 Subject: [PATCH 20/20] translated 13_extras.jl --- literate_notebooks/src-PT-BR/13_extras.jl | 173 +++++++++++----------- 1 file changed, 87 insertions(+), 86 deletions(-) diff --git a/literate_notebooks/src-PT-BR/13_extras.jl b/literate_notebooks/src-PT-BR/13_extras.jl index 5140a31..760fd10 100644 --- a/literate_notebooks/src-PT-BR/13_extras.jl +++ b/literate_notebooks/src-PT-BR/13_extras.jl @@ -1,198 +1,199 @@ -# # Introduction to DataFrames -# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), May 13, 2018** +# # Introdução ao DataFrames +# **[Bogumił Kamiński](http://bogumilkaminski.pl/about/), 23 de Maio de 2018** +# +# Tradução de [Jose Storopoli](https://storopoli.io). using DataFrames -# ## Extras - selected functionalities of selected packages +# ## Extras - Pacotes adicionais interessantes -#- +# - -# ### FreqTables: creating cross tabulations +# ### FreqTables: criando tabulações cruzadas using FreqTables df = DataFrame(a=rand('a':'d', 1000), b=rand(["x", "y", "z"], 1000)) -ft = freqtable(df, :a, :b) # observe that dimensions are sorted if possible +ft = freqtable(df, :a, :b) # observe que as dimensões são ordenadas, se possível -#- +# - -ft[1,1], ft['b', "z"] # you can index the result using numbers or names +ft[1,1], ft['b', "z"] # você pode indexar o resultado usando números ou nomes -#- +# - -prop(ft, 1) # getting proportions - 1 means we want to calculate them in rows (first dimension) +prop(ft, 1) # obter proporções - 1 significa que queremos calculá-las em linhas (primeira dimensão) -#- +# - -prop(ft, 2) # and columns are normalized to 1.0 now +prop(ft, 2) # e as colunas são normalizadas para 1.0 agora -#- +# - x = categorical(rand(1:3, 10)) -levels!(x, [3, 1, 2, 4]) # reordering levels and adding an extra level -freqtable(x) # order is preserved and not-used level is shown +levels!(x, [3, 1, 2, 4]) # reordenando níveis e adicionando um nível extra +freqtable(x) # a ordem é preservada e o nível não usado é mostrado -#- +# - -freqtable([1,1,2,3,missing]) # by default missings are listed +freqtable([1,1,2,3,missing]) # por padrão `missing`s são listados -#- +# - -freqtable([1,1,2,3,missing], skipmissing=true) # but we can skip them +freqtable([1,1,2,3,missing], skipmissing=true) # mas podemos ignorá-los -# ### DataFramesMeta - working on `DataFrame` +# ### DataFramesMeta - trabalhando em `DataFrame` using DataFramesMeta df = DataFrame(x=1:8, y='a':'h', z=repeat([true,false], outer=4)) -#- +# - -@with(df, :x+:z) # expressions with columns of DataFrame +@with(df, :x + :z) # expressões com colunas de DataFrame -#- +# - -@with df begin # you can define code blocks +@with df begin # você pode definir blocos de código com `begin` e `end` a = :x[:z] b = :x[.!:z] :y + [a; b] end -#- +# - -a # @with creates hard scope so variables do not leak out +a # @with cria um escopo rígido para que as variáveis não vazem -#- +# - -df2 = DataFrame(a = [:a, :b, :c]) -@with(df2, :a .== ^(:a)) # sometimes we want to work on raw Symbol, ^() escapes it +df2 = DataFrame(a=[:a, :b, :c]) +@with(df2, :a .== ^(:a)) # às vezes queremos trabalhar no símbolo bruto, ^() permite isso -#- +# - df2 = DataFrame(x=1:3, y=4:6, z=7:9) -@with(df2, _I_(2:3)) # _I_(expression) is translated to df2[expression] +@with(df2, _I_(2:3)) # _I_(expressão) é traduzido para df2[expressão] -#- +# - -@where(df, :x .< 4, :z .== true) # very useful macro for filtering +@where(df, :x .< 4, :z .== true) # macro muito útil para filtragem -#- +# - -@select(df, :x, y = 2*:x, z=:y) # create a new DataFrame based on the old one +@select(df, :x, y = 2 * :x, z = :y) # crie um novo DataFrame baseado no antigo -#- +# - -@transform(df, a=1, x = 2*:x, y=:x) # create a new DataFrame adding columns based on the old one +@transform(df, a = 1, x = 2 * :x, y = :x) # crie um novo DataFrame adicionando colunas com base no antigo -#- +# - -@transform(df, a=1, b=:a) # old DataFrame is used and :a is not present there +@transform(df, a = 1, b = :a) # antigo DataFrame é usado e :a não está presente nele -#- +# - -@orderby(df, :z, -:x) # sorting into a new data frame, less powerful than sort, but lightweight +@orderby(df, :z, -:x) # ordenando em um novo data frame, menos poderoso que sort, mas menos pesado -#- +# - -@linq df |> # chaining of operations on DataFrame +@linq df |> # encadeamento de operações no DataFrame where(:x .< 5) |> orderby(:z) |> transform(x²=:x.^2) |> select(:z, :x, :x²) -#- +# - -f(df, col) = df[col] # you can define your own functions and put them in the chain +f(df, col) = df[col] # você pode definir suas próprias funções e colocá-las na cadeia @linq df |> where(:x .<= 4) |> f(:x) -# ### DataFramesMeta - working on grouped `DataFrame` +# ### DataFramesMeta - trabalhando em `DataFrame` agrupados -df = DataFrame(a = 1:12, b = repeat('a':'d', outer=3)) +df = DataFrame(a=1:12, b=repeat('a':'d', outer=3)) g = groupby(df, :b) -#- +# - -@by(df, :b, first=first(:a), last=last(:a), mean=mean(:a)) # more convinient than by from DataFrames +@by(df, :b, first = first(:a), last = last(:a), mean = mean(:a)) # mais conveniente do que o by do DataFrames -#- +# - -@based_on(g, first=first(:a), last=last(:a), mean=mean(:a)) # the same as by but on grouped DataFrame +@based_on(g, first = first(:a), last = last(:a), mean = mean(:a)) # o mesmo que by, mas no DataFrame agrupado -#- +# - -@where(g, mean(:a) > 6.5) # filter gropus on aggregate conditions +@where(g, mean(:a) > 6.5) # filtrar grupos usando condições agregadas -#- +# - -@orderby(g, -sum(:a)) # order groups on aggregate conditions +@orderby(g, -sum(:a)) # ordenar grupos usando condições agregadas -#- +# - -@transform(g, center = mean(:a), centered = :a - mean(:a)) # perform operations within a group and return ungroped DataFrame +@transform(g, center = mean(:a), centered = :a - mean(:a)) # realizar operações dentro de um grupo e retornar DataFrame não agrupado -#- +# - -DataFrame(g) # a nice convinience function not defined in DataFrames +DataFrame(g) # uma função de conveniência interessante não definida em DataFrames -#- +# - -@transform(g) # actually this is the same +@transform(g) # na verdade este é o mesmo -#- +# - -@linq df |> groupby(:b) |> where(mean(:a) > 6.5) |> DataFrame # you can do chaining on grouped DataFrames as well +@linq df |> groupby(:b) |> where(mean(:a) > 6.5) |> DataFrame # você pode fazer o encadeamento em DataFrames agrupados também -# ### DataFramesMeta - rowwise operations on `DataFrame` +# ### DataFramesMeta - operações por linhas (*rowwise*) em `DataFrame` -df = DataFrame(a = 1:12, b = repeat(1:4, outer=3)) +df = DataFrame(a=1:12, b=repeat(1:4, outer=3)) -#- +# - -## such conditions are often needed but are complex to write +## tais condições são frequentemente necessárias, mas são complexas de expressar @transform(df, x = ifelse.((:a .> 6) .& (:b .== 4), "yes", "no")) -#- +# - -## one option is to use a function that works on a single observation and broadcast it +## uma opção é usar uma função que funcione em uma única observação e transmiti-la (*broadcast*) myfun(a, b) = a > 6 && b == 4 ? "yes" : "no" @transform(df, x = myfun.(:a, :b)) -#- +# - -## or you can use @byrow! macro that allows you to process DataFrame rowwise +## ou você pode usar o macro @byrow! que permite processar DataFrame por linhas (*rowwise*) @byrow! df begin @newcol x::Vector{String} :x = :a > 6 && :b == 4 ? "yes" : "no" end -# ### Visualizing data with StatPlots +# ### Visualização de dados com StatPlots -using StatPlots # you might need to setup Plots package and some plotting backend first +using StatPlots # você pode precisar configurar o pacote Plots e algum backend gráfico primeiro -#- +# - -## we present only a minimal functionality of the package +## apresentamos apenas uma funcionalidade mínima do pacote -#- +# - srand(1) -df = DataFrame(x = sort(randn(1000)), y=randn(1000), z = [fill("b", 500); fill("a", 500)]) +df = DataFrame(x=sort(randn(1000)), y=randn(1000), z=[fill("b", 500); fill("a", 500)]) -#- +# - -@df df plot(:x, :y, legend=:topleft, label="y(x)") # a most basic plot +@df df plot(:x, :y, legend=:topleft, label="y(x)") # o gráfico mais básico possível -#- +# - -@df df density(:x, label="") # density plot +@df df density(:x, label="") # gráfico de densidade -#- +# - -@df df histogram(:y, label="y") # and a histogram +@df df histogram(:y, label="y") # e um histograma -#- +# - @df df boxplot(:z, :x, label="x") -#- +# - @df df violin(:z, :y, label="y") -