Using rol(a,1)
on a=BitArray([true,true,false])
yields the following result:
julia> rol(a,1)
3-element BitArray{1}:
true
false
true
How can I rotate non-Bit Arrays? For example I have b=[1,2,3,4]
and would like to get the following output: [2,3,4,1]
.
you're looking for circshift
:
julia> circshift([1,2,3,4], -1)
4-element Array{Int64,1}:
2
3
4
1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With