Skip to content
This repository has been archived by the owner on May 5, 2019. It is now read-only.

Commit

Permalink
remove RepeatedVector, StackedVector, unstackdt, meltdt
Browse files Browse the repository at this point in the history
  • Loading branch information
cjprybol committed Mar 14, 2017
1 parent cc95658 commit 06dc914
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 366 deletions.
2 changes: 0 additions & 2 deletions docs/src/lib/manipulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ join
melt
stack
unstack
stackdt
meltdt
```
23 changes: 0 additions & 23 deletions docs/src/man/reshaping_and_pivoting.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,6 @@ If the remaining columns are unique, you can skip the id variable and use:
widedt = unstack(longdt, :variable, :value)
```

`stackdt` and `meltdt` are two additional functions that work like `stack` and `melt`, but they provide a view into the original wide DataTable. Here is an example:

```julia
d = stackdt(iris)
```

This saves memory. To create the view, several AbstractVectors are defined:

`:variable` column -- `EachRepeatedVector`
This repeats the variables N times where N is the number of rows of the original AbstractDataTable.

`:value` column -- `StackedVector`
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:

```julia
dump(stackdt(iris))
```

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:

```julia
Expand Down
2 changes: 0 additions & 2 deletions src/DataTables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export @~,
eltypes,
groupby,
melt,
meltdt,
names!,
ncol,
nonunique,
Expand All @@ -71,7 +70,6 @@ export @~,
rename,
showcols,
stack,
stackdt,
unique!,
unstack,
head,
Expand Down
5 changes: 2 additions & 3 deletions src/abstractdatatable/abstractdatatable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,6 @@ end
Convert columns with a `Nullable` element type without any null values
to a non-`Nullable` equivalent array type. The table `dt` is modified in place.
`NullableVectors` are aliased to their `values` field.
# Examples
Expand Down Expand Up @@ -852,7 +851,7 @@ julia> eltypes(dt)
See also [`denullify!`] & [`nullify`](@ref).
"""
denullify(dt::AbstractDataTable) = denullify!(copy(dt))
denullify(dt::AbstractDataTable) = denullify!(deepcopy(dt))

"""
nullify!(dt::AbstractDataTable)
Expand Down Expand Up @@ -933,7 +932,7 @@ julia> eltypes(dt)
See also [`nullify!`](@ref) & [`denullify`](@ref).
"""
function nullify(dt::AbstractDataTable)
nullify!(copy(dt))
nullify!(deepcopy(dt))
end

## Documentation for methods defined elsewhere
Expand Down

1 comment on commit 06dc914

@nalimilan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you keep this for another PR? That one is already long enough.

Please sign in to comment.