1
$\begingroup$

I have the following list:

{{0, 0.0621386}, {1, 0.0407129}, {2, 0.0201584}}

I wonder how can I select the second element and make two lists as:

{{0.0621386}, {0.0407129}, {0.0201584}}

and also:

 {0.0621386, 0.0407129, 0.0201584}
$\endgroup$

closed as off-topic by corey979, Henrik Schumacher, m_goldberg, MarcoB, Coolwater Apr 27 '18 at 8:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – corey979, Henrik Schumacher, m_goldberg, MarcoB, Coolwater
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ lst[[All, 2]] $\endgroup$ – Okkes Dulgerci Apr 26 '18 at 15:05
3
$\begingroup$
lst = {{0, 0.0621386}, {1, 0.0407129}, {2, 0.0201584}};

lst[[All, {-1}]]

{{0.0621386}, {0.0407129}, {0.0201584}}

lst[[All, -1]]

{0.0621386, 0.0407129, 0.0201584}

You can also use lst[[;; , {-1}]] and lst[[;; ,-1]].

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.