Comments (9)
I believe this is a very basic device that is useful out of this package. For example, it may also be useful in constructing contingency tables (see JuliaStats/StatsKit.jl#32).
What about we implement this in Stats.jl and thus provide such support to other packages that may also want it?
from dataarrays.jl.
That works for me. What interface will we be using? Something like `levelsmap(["a", "b", "A", "A"]) -> ["a" => 1, "b" => 2, "A" => 3]?
from dataarrays.jl.
FWIW, there's already indexmap
in Stats.jl. (see https://github.com/JuliaStats/Stats.jl#miscelleneous-functions)
from dataarrays.jl.
We don't want to use that as our canonical numbering, right? That could produce numbers that are spaced very unevenly.
from dataarrays.jl.
Oh, yes ... we can then add a levelmap
method for this?
from dataarrays.jl.
That seems right to me. Should I submit a PR to discuss implementation details?
from dataarrays.jl.
Sure.
from dataarrays.jl.
Think about it more. Probably, we may want a data structure that maintain cross-reference between levels & indexes.
Something along this line?
immutable LevelMap{T}
levels::Vector{T} # index -> level
indmap::Dict{T, Int} # level -> index
end
with some functions to make doing the translation convenient.
from dataarrays.jl.
Not sure. For involved indexing operations, it seems like you'd want to maintain all of the indices for each level since that would make it much easier to repeat the levels calculation on subsets of the data.
from dataarrays.jl.
Related Issues (20)
- #undef/uninitialised values from unique on PooledDataArray
- Get rid of @ngenerate
- Missing DataArray{T}(dims) constructors HOT 1
- MethodError in pooleddataarray.jl in Julia 0.6 HOT 7
- Inference failure/indexing issues HOT 14
- View on DataArray makes copy HOT 1
- broadcast() inference issue with mean() and > HOT 5
- In v 0.7 precompile fails with typeassert HOT 1
- `safe_mapslices` at test/reducedim.jl is broken on 0.7 HOT 2
- Can't load DataArrays HOT 9
- Weighted mean broken for matrices HOT 1
- Avoid copying input Array{Union{T, Null}} in DataArray{T} constructor
- getindex broken when using multidimensional index of DataArray{Bool}
- Division DataArray{Int} / Int results in Array{Any} HOT 2
- doesn't load on julia v0.7 because of `printf` HOT 1
- PooledDataArray depreciated? HOT 1
- Julia v0.7 compatibility HOT 9
- "UndefVarError: centralizedabs2fun not defined" while precompiling HOT 3
- Julia-1.0.0 Compile Error HOT 3
- Package compatibility caps
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataarrays.jl.