AxisKeys.jl icon indicating copy to clipboard operation
AxisKeys.jl copied to clipboard

🎹

Results 65 AxisKeys.jl issues
Sort by recently updated
recently updated
newest added

I went as far as implementing my own method for this before thinking to look at the source code and discovering the already existing support for this operation!

Maybe this should be an error? ```julia julia> using AxisKeys julia> ka = wrapdims(rand(3, 2), obs=1:3, point=["a", "b"]); julia> kb = wrapdims(rand(3, 2), obs=1:3, point=["c", "d"]); julia> ProjectTo(ka)(kb) 2-dimensional KeyedArray(NamedDimsArray(...))...

Rewrites `populate!` to operate columnwise over tables. Also, requires manually calling `findall` with the axiskeys and columns. With these changes the `wrapdims` call is ~5x faster and allocations 25% of...

it wasn't possible to simply index by key if keys are intervals themlselves

As I understand, currently there is no way to set a single value specified by names and keys, as in `Nc(obs='a', iter=20, :) .= 1000`. This PR adds makes it...

I ran into this when using `wrapdims` on a DataFrame which had a column containing vectors, leading `wrapdims` (which calls `similar`) to produce a KeyedArray with `#undef` values Is `wrapdims`...

I love being able to do this but always have to dig a bit to remember how it's called. Possibly on purpose, as it is not exported? Would it be...

Compare ```julia julia> rand(5)[:, :] 5×1 Matrix{Float64}: 0.9821831290750086 0.3574801822912895 0.36794326869601435 0.39263359417430765 0.45195237298701174 julia> wrapdims(rand(5); obs=1:5)[:, :] ERROR: BoundsError: attempt to access Tuple{Symbol} at index [2] Stacktrace: [1] macro expansion @...

I decided to go with pairs vs kwargs because: 1. I wanted to support unnamed dims 2. The nested pair syntax of `oldname => newname => newvalues` seemed more intuitive...

This is basically what [pandas.pivot_table](https://pandas.pydata.org/docs/reference/api/pandas.pivot_table.html) does. Here's a naive implementation. I imagine this could be done more efficiently though. ```julia julia> function wrap_reduce(df, aggregator, val, keys...) grp = groupby(df, collect(keys))...