Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8072

select 1st column element based on criteria in 2nd AND 3rd column

From hanciong awesome <hanciong@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject select 1st column element based on criteria in 2nd AND 3rd column
Date 2012-01-21 10:25 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jfe3q1$a2i$1@smc.vnet.net> (permalink)

Show all headers | View raw


Hello all, suppose I have a table:

pairs = {{1, 3, 4}, {2, 4, 6}, {3, 6, 7}, {4, 1, 8}, {5, 3, 9}, {6, 2,
    10}, {7, 5, 11}, {8, 2, 13}, {2, 3, 4}, {5, 6, 7}}

how to select rows for which the 2nd column is between 3 and 5, AND
the 3rd column is between 7 and 10? So I want to do something similar
to this:

Select[pairs, 5 >= #[[2]] >= 3 &  AND  10 >= #[[3]] >= 7]

but I just couldn't get it to work. what should I do? Thank you

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

select 1st column element based on criteria in 2nd AND 3rd column hanciong awesome <hanciong@gmail.com> - 2012-01-21 10:25 +0000
  Re: select 1st column element based on criteria in 2nd AND 3rd column "Nasser M. Abbasi" <nma@12000.org> - 2012-01-22 12:29 +0000
  Re: select 1st column element based on criteria in 2nd AND 3rd column "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2012-01-22 12:28 +0000

csiph-web