diff --git a/docs/src/man/reshaping_and_pivoting.md b/docs/src/man/reshaping_and_pivoting.md index 9688cca6db..a94c7370d8 100644 --- a/docs/src/man/reshaping_and_pivoting.md +++ b/docs/src/man/reshaping_and_pivoting.md @@ -274,146 +274,6 @@ This is provides a view of the original columns stacked together. Id columns -- `RepeatedVector` This repeats the original columns N times where N is the number of columns stacked. -For more details on the storage representation, see: - -```jldoctest reshape -julia> dump(stackdf(iris)) -DataFrames.DataFrame 600 observations of 4 variables - variable: DataFrames.RepeatedVector{Symbol} - parent: Array{Symbol}((4,)) - 1: Symbol SepalLength - 2: Symbol SepalWidth - 3: Symbol PetalLength - 4: Symbol PetalWidth - inner: Int64 150 - outer: Int64 1 value: DataFrames.StackedVector - components: Array{Any}((4,)) - 1: Array{Float64}((150,)) [5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9 … 6.7, 6.9, 5.8, 6.8, 6.7, 6.7, 6.3, 6.5, 6.2, 5.9] - 2: Array{Float64}((150,)) [3.5, 3.0, 3.2, 3.1, 3.6, 3.9, 3.4, 3.4, 2.9, 3.1 … 3.1, 3.1, 2.7, 3.2, 3.3, 3.0, 2.5, 3.0, 3.4, 3.0] - 3: Array{Float64}((150,)) [1.4, 1.4, 1.3, 1.5, 1.4, 1.7, 1.4, 1.5, 1.4, 1.5 … 5.6, 5.1, 5.1, 5.9, 5.7, 5.2, 5.0, 5.2, 5.4, 5.1] - 4: Array{Float64}((150,)) [0.2, 0.2, 0.2, 0.2, 0.2, 0.4, 0.3, 0.2, 0.2, 0.1 … 2.4, 2.3, 1.9, 2.3, 2.5, 2.3, 1.9, 2.0, 2.3, 1.8] Species: DataFrames.RepeatedVector{CategoricalArrays.CategoricalValue{String,UInt32}} - parent: CategoricalArrays.CategoricalArray{String,1,UInt32,String,Union{}} - refs: Array{UInt32}((150,)) UInt32[0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001 … 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003] - pool: CategoricalArrays.CategoricalPool{String,UInt32,CategoricalArrays.CategoricalValue{String,UInt32}} - index: Array{String}((3,)) - 1: String "setosa" - 2: String "versicolor" - 3: String "virginica" - invindex: Dict{String,UInt32} - slots: Array{UInt8}((16,)) UInt8[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00] - keys: Array{String}((16,)) - 1: #undef - 2: #undef - 3: #undef - 4: #undef - 5: #undef - ... - 12: #undef - 13: String "setosa" - 14: String "versicolor" - 15: #undef - 16: #undef - vals: Array{UInt32}((16,)) UInt32[0x04e581f0, 0x00000001, 0x00000000, 0x00000000, 0x04e5c018, 0x00000001, 0x00000003, 0x00000001, 0x00000000, 0x00000000, 0x04e5c018, 0x00000001, 0x00000001, 0x00000002, 0x00000000, 0x00000000] - ndel: Int64 0 - count: Int64 3 - age: UInt64 3 - idxfloor: Int64 7 - maxprobe: Int64 1 - order: Array{UInt32}((3,)) UInt32[0x00000001, 0x00000002, 0x00000003] - levels: Array{String}((3,)) - 1: String "setosa" - 2: String "versicolor" - 3: String "virginica" - valindex: Array{CategoricalArrays.CategoricalValue{String,UInt32}}((3,)) - 1: CategoricalArrays.CategoricalValue{String,UInt32} - level: UInt32 1 - pool: CategoricalArrays.CategoricalPool{String,UInt32,CategoricalArrays.CategoricalValue{String,UInt32}} - index: Array{String}((3,)) - 1: String "setosa" - 2: String "versicolor" - 3: String "virginica" - invindex: Dict{String,UInt32} - slots: Array{UInt8}((16,)) UInt8[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00] - keys: Array{String}((16,)) - vals: Array{UInt32}((16,)) UInt32[0x04e581f0, 0x00000001, 0x00000000, 0x00000000, 0x04e5c018, 0x00000001, 0x00000003, 0x00000001, 0x00000000, 0x00000000, 0x04e5c018, 0x00000001, 0x00000001, 0x00000002, 0x00000000, 0x00000000] - ndel: Int64 0 - count: Int64 3 - age: UInt64 3 - idxfloor: Int64 7 - maxprobe: Int64 1 - order: Array{UInt32}((3,)) UInt32[0x00000001, 0x00000002, 0x00000003] - levels: Array{String}((3,)) - 1: String "setosa" - 2: String "versicolor" - 3: String "virginica" - valindex: Array{CategoricalArrays.CategoricalValue{String,UInt32}}((3,)) - 1: CategoricalArrays.CategoricalValue{String,UInt32} - 2: CategoricalArrays.CategoricalValue{String,UInt32} - 3: CategoricalArrays.CategoricalValue{String,UInt32} - ordered: Bool false - 2: CategoricalArrays.CategoricalValue{String,UInt32} - level: UInt32 2 - pool: CategoricalArrays.CategoricalPool{String,UInt32,CategoricalArrays.CategoricalValue{String,UInt32}} - index: Array{String}((3,)) - 1: String "setosa" - 2: String "versicolor" - 3: String "virginica" - invindex: Dict{String,UInt32} - slots: Array{UInt8}((16,)) UInt8[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00] - keys: Array{String}((16,)) - vals: Array{UInt32}((16,)) UInt32[0x04e581f0, 0x00000001, 0x00000000, 0x00000000, 0x04e5c018, 0x00000001, 0x00000003, 0x00000001, 0x00000000, 0x00000000, 0x04e5c018, 0x00000001, 0x00000001, 0x00000002, 0x00000000, 0x00000000] - ndel: Int64 0 - count: Int64 3 - age: UInt64 3 - idxfloor: Int64 7 - maxprobe: Int64 1 - order: Array{UInt32}((3,)) UInt32[0x00000001, 0x00000002, 0x00000003] - levels: Array{String}((3,)) - 1: String "setosa" - 2: String "versicolor" - 3: String "virginica" - valindex: Array{CategoricalArrays.CategoricalValue{String,UInt32}}((3,)) - 1: CategoricalArrays.CategoricalValue{String,UInt32} - 2: CategoricalArrays.CategoricalValue{String,UInt32} - 3: CategoricalArrays.CategoricalValue{String,UInt32} - ordered: Bool false - 3: CategoricalArrays.CategoricalValue{String,UInt32} - level: UInt32 3 - pool: CategoricalArrays.CategoricalPool{String,UInt32,CategoricalArrays.CategoricalValue{String,UInt32}} - index: Array{String}((3,)) - 1: String "setosa" - 2: String "versicolor" - 3: String "virginica" - invindex: Dict{String,UInt32} - slots: Array{UInt8}((16,)) UInt8[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00] - keys: Array{String}((16,)) - vals: Array{UInt32}((16,)) UInt32[0x04e581f0, 0x00000001, 0x00000000, 0x00000000, 0x04e5c018, 0x00000001, 0x00000003, 0x00000001, 0x00000000, 0x00000000, 0x04e5c018, 0x00000001, 0x00000001, 0x00000002, 0x00000000, 0x00000000] - ndel: Int64 0 - count: Int64 3 - age: UInt64 3 - idxfloor: Int64 7 - maxprobe: Int64 1 - order: Array{UInt32}((3,)) UInt32[0x00000001, 0x00000002, 0x00000003] - levels: Array{String}((3,)) - 1: String "setosa" - 2: String "versicolor" - 3: String "virginica" - valindex: Array{CategoricalArrays.CategoricalValue{String,UInt32}}((3,)) - 1: CategoricalArrays.CategoricalValue{String,UInt32} - 2: CategoricalArrays.CategoricalValue{String,UInt32} - 3: CategoricalArrays.CategoricalValue{String,UInt32} - ordered: Bool false - ordered: Bool false - inner: Int64 1 - outer: Int64 4 id: DataFrames.RepeatedVector{Int64} - parent: UnitRange{Int64} - start: Int64 1 - stop: Int64 150 - inner: Int64 1 - outer: Int64 4 - -``` - None of these reshaping functions perform any aggregation. To do aggregation, use the split-apply-combine functions in combination with reshaping. Here is an example: ```jldoctest reshape