Comments (10)
we've got stack/unstack. Someone should sit down and try to figure out if that's good enough or if we need additional functionality.
from dataframes.jl.
I'm sure you guys are aware of the [reshape] and [reshape2]. Also worth considering is the find/sparse functions in Matlab that kind of do similar things and are a really classic design.
from dataframes.jl.
I find that the stack
/ unstack
API is much less helpful than the cast
/ melt
API. At some point, I'd like to go through and clean this up.
from dataframes.jl.
The existing stack(df, ["colX", "colY"]
is equivalent of Hadley's melt(df, measure.vars = c("colX", "colY")
. I added versions of melt
and melt_df
that use stack
and stack_df
. The only difference really is that the melt
functions prefer id_vars
.
That was the easy part. cast
is the tough one.
from dataframes.jl.
It would be really nice to use id_vars
instead. That's just a set complement, right?
from dataframes.jl.
Yes it is. That's what the new melt
does. If df has columns x1 through x4, melt(df, ["x1", "x2"])
is the same as stack(df, ["x3","x4"])
. Both functions also allow three arguments.
from dataframes.jl.
Ah. Much better! This is looking really promising.
from dataframes.jl.
More changes here. I added a simplistic pivot_table
function. The purpose is like Hadley's dcast
or Wes's pivot_table
. The format is pivot_table(d, R, C, D, fun)
where R and C are vectors indicating columns that are to be pivoted to either rows or columns in the results. D is the column to take for data. fun
is the function to apply to aggregate (defaults to mean
if left off).
from dataframes.jl.
Also, I changed to argument order for unstack
to match that of pivot_table
.
from dataframes.jl.
I'm closing as we've got most basics between stack
, unstack
, melt
, and pivot_table
. pivot_table
is like Hadley's cast. It's still fairly limited, so folks can add specific feature requests.
from dataframes.jl.
Related Issues (20)
- Segmentation Fault when reading compressed file HOT 1
- Revisit spreading for `AsTable` output` HOT 6
- Better error message when forming a DataFrame from a vector of dictionaries with missing data. HOT 2
- `describe` is slow HOT 3
- CartesianIndex error in Julia 1.11 HOT 4
- `DataFrame(x=Int[], y=Int)` HOT 3
- Add comparison function for dataframes which can handle both isapprox and isequal column types HOT 2
- unique fails with column-type FixedDecimal HOT 5
- mapcols! should modify the parent of a SubDataFrame HOT 11
- Feature request: Pairs in stack HOT 2
- Grouped DataFrame with array elements fails to combine HOT 4
- error when combining a grouped empty dataframe using `first` HOT 6
- Short circuit && on subset? HOT 1
- Integer strings as colnames/selectors are error prone HOT 2
- Suggestion - Matrix Syntax for hcat (as well as vcat) HOT 4
- Document custom generation of column names in manual HOT 9
- `join` should not introduce `Missing` types to schema HOT 1
- Consider removing Tables.allocatecolumn in vcat
- DataFrame(t::Table) converts PooledVector columns HOT 2
- Sampling GroupedDataFrames (rand) HOT 5
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 dataframes.jl.