- #1
rynlee
- 45
- 0
Hi All,
does anyone know of a mathematica function that efficiently circularly shifts all array elements?
e.g.
{1,2,3,4,5} -> {4,5,1,2,3}
without iterating? The reason I ask is because I have a huge data set I'm working with and right now iterating through is very processing intensive and is taking forever. I figured out a way to do what I need to do however via vector operations without the need to iterate, which I suspect may be a more efficient process in the mathematica back end, but to do so I need to perform this circular transformation first, and iterating through each element would defeat the purpose.
Thanks,
ryn
does anyone know of a mathematica function that efficiently circularly shifts all array elements?
e.g.
{1,2,3,4,5} -> {4,5,1,2,3}
without iterating? The reason I ask is because I have a huge data set I'm working with and right now iterating through is very processing intensive and is taking forever. I figured out a way to do what I need to do however via vector operations without the need to iterate, which I suspect may be a more efficient process in the mathematica back end, but to do so I need to perform this circular transformation first, and iterating through each element would defeat the purpose.
Thanks,
ryn