Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #4547 > unrolled thread
| Started by | Bob Hanlon <hanlonr@cox.net> |
|---|---|
| First post | 2011-08-24 11:50 +0000 |
| Last post | 2011-08-24 11:50 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Nested List Abs[] Bob Hanlon <hanlonr@cox.net> - 2011-08-24 11:50 +0000
| From | Bob Hanlon <hanlonr@cox.net> |
|---|---|
| Date | 2011-08-24 11:50 +0000 |
| Subject | Re: Nested List Abs[] |
| Message-ID | <j32oir$ds5$1@smc.vnet.net> |
data = RandomReal[{0, 2}, {100, 2}];
data2 = Select[data, Abs[#[[1]] - #[[2]]] < 1 &];
data3 = Select[data, Abs[Subtract @@ #] < 1 &];
data2 == data3
True
Length[data2]
71
Bob Hanlon
---- Sam Korn <sam@kornfamily.com> wrote:
=============
I have a list, and each element of the
list is a sublist with two integers. How do I delete from the larger
list any integer pair whose numerical distance apart is greater than
one? I'd been trying to map Abs[Subtract[#1,#2]]&<1 over the list, but
so far that hasn't worked.
Any suggestions?
Sent from my iPhone
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web