Just learned from this answer by ciaothis answer by ciao that Downsample
is made for this kind of task:
Downsample[#, {1, 2}] & /@ lis1
(* {{{a1, c1, e1}, {a2, c2, e2}}, {{a3, c3, e3}, {a4, c4, e4}}} *)
You can also use Take
, Drop
and Extract
to get the same result:
Take[#, All, {1, -1, 2}] & /@ lis1
Drop[#, {}, {2, -1, 2}] & /@ lis1
First@Rest@Extract[lis1, {{0}, {;; , ;; , ;; ;; 2}}]
You can use arbitrary lists for Part
specifications with Part
and Extract
. For example
#[[All, ;; , {1, 4, 5}]] &@lis1 (* or *)
First@Rest@Extract[lis1, {{0}, {All, ;; , {1, 4, 5}}}]
both give all rows and columns 1, 4 and 5
in all matrices in lis1
:
(* {{{a1, d1, e1}, {a2, d2, e2}}, {{a3, d3, e3}, {a4, d4, e4}}} *)