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


Groups > comp.soft-sys.math.mathematica > #2708 > unrolled thread

Re: Position

Started byDrMajorBob <btreat1@austin.rr.com>
First post2011-05-25 23:31 +0000
Last post2011-05-25 23:31 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Position DrMajorBob <btreat1@austin.rr.com> - 2011-05-25 23:31 +0000

#2708 — Re: Position

FromDrMajorBob <btreat1@austin.rr.com>
Date2011-05-25 23:31 +0000
SubjectRe: Position
Message-ID<irk3h8$77p$1@smc.vnet.net>
Position's second argument should be a pattern, not a test.

A test can be turned into a pattern, on the other hand:

Position[data, x_/;x >= .95]

or

Position[data, x_?(x >= .95&)]

Bobby

On Wed, 25 May 2011 04:54:45 -0500, Joerg Schroeder  
<sd-gymwalsrode@gmx.de> wrote:

> Dear Group,
>
> I don't understand the following:
>
> I have a list of data and want to find the position of special elements:
>
> data=Table[CDF[BinomialDistribution[150,0.3],k],{k,0,150}]
>
> Position[data,#>=0.95&]
>
> With this I get {} (null set) as an answer, whereas for example Select  
> gives the answer I expect.
>
> Select[data,#>=0.95&]
>
> Do I do something wrong with Position?
>
> Thanks
>
> Jorg Schroder


-- 
DrMajorBob@yahoo.com

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web