rafaqz / DimensionalData.jl

Named dimensions and indexing for julia arrays and other data
https://rafaqz.github.io/DimensionalData.jl/stable/
MIT License
271 stars 38 forks source link

Add interleave function #520

Open rafaqz opened 1 year ago

rafaqz commented 1 year ago

When we two AbstractDimArray that share some dimensions we can cat them together assuming they don't overlap.

But what if they represent e.g. two timeseries over the same timeline that we want to interleave into a single time series? (or whatever with a shared dimension)

We could interleave the slices to make a new series along the same dimension. If there are slices with the same time we can compare them, and throw an error if theyre different - or with a keyword just take the first one we find for any slice.

This could also be an obscure requirement. but I have heaps of historical data like this...

rafaqz commented 6 months ago

This is like a join in that we have to specify which side to take data from when they match. But we always take all the data from both where they don't.

Also wondering what it means in multiple dimensions. Do we fill gaps with missing?

And for intervals? how would we deal with overlaps? Again with the left/right object coming out on top?