# Generate a new list

Suppose we have the following sample data

data = {{{10.4239, -0.0208131, 0.439032}, {10.379, -0.0194723,
0.737773}}, {{10.3581, 0.00106231, 0.84059}, {10.379, 0.0214038,
0.733933}}}


How can I create a new list containing only the first and second (or second and third) elements of the sublists? In other words how can I get this

data2 = {{{10.4239, -0.0208131}, {10.379, -0.0194723}}, {{10.3581,
0.00106231, {10.379, 0.0214038}}}


Many thanks in advance!

• You can also use patterns data //. {a_, b_, c__} :> {a, b} – Rorschach Dec 7 '15 at 7:31

data[[;; , ;; , 1 ;; 2]] gives the required answer. (Ref.)
• Or data[[;; , ;; , {1,3}]] if I want the first and the third element, correct? – Vaggelis_Z Nov 24 '15 at 17:32
• You can also use All in place of ;;. – evanb Nov 24 '15 at 17:57