From 44b3138052d25e13473b23210ce454d5a1670603 Mon Sep 17 00:00:00 2001 From: Pietro Vertechi Date: Thu, 25 Apr 2019 15:59:44 +0100 Subject: [PATCH] Iterate named tuples in mapslices --- src/flatten.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flatten.jl b/src/flatten.jl index ba9d235a..8c1e7424 100644 --- a/src/flatten.jl +++ b/src/flatten.jl @@ -19,7 +19,7 @@ function mapslices(f, x::NDSparse, dims; name = nothing) iterdims = setdiff([1:ndims(x);], map(d->fieldindex(columns(x.index),d), dims)) idx = Any[Colon() for v in columns(x.index)] - iter = Columns(astuple(columns(x.index))[[iterdims...]]) + iter = Columns(getsubfields(columns(x.index), [iterdims...])) if !isempty(dims) || !issorted(iter) iter = sort(iter) end