Stream: helpdesk (published)

Topic: ✔ Sorting StructArrays


view this post on Zulip Davi Sales Barreira (Mar 25 2024 at 16:57):

Is there an easy way of sorting StructArrays? I've been using Transducers.jl to manipulate the data. But I didn't find how it can be used to sort the data.

view this post on Zulip aplavin (Mar 25 2024 at 17:03):

Can you elaborate the problem? Regular sort(A) and sort(A; by=...) work with StructArrays.

view this post on Zulip Davi Sales Barreira (Mar 25 2024 at 17:05):

aplavin said:

Can you elaborate the problem? Regular sort(A) and sort(A; by=...) work with StructArrays.

I was trying sort(A, :x).

view this post on Zulip Davi Sales Barreira (Mar 25 2024 at 17:06):

Oh, so it works with sort(A, by=x->x.x).

view this post on Zulip Davi Sales Barreira (Mar 25 2024 at 17:07):

Thanks, @aplavin .

view this post on Zulip Notification Bot (Mar 25 2024 at 17:08):

Davi Sales Barreira has marked this topic as resolved.


Last updated: Dec 28 2024 at 04:38 UTC