MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to use Pick[]; Is this a bug?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127699] Re: How to use Pick[]; Is this a bug?
  • From: Peter Pein <petsie at dordos.net>
  • Date: Wed, 15 Aug 2012 03:37:06 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <k0d1sm$lvc$1@smc.vnet.net>

Am 14.08.2012 10:22, schrieb benp84 at gmail.com:
> In[1]:=  Pick[{1, 2, 3, 4, 5}, {9, 0, 7, 0, 6}, Except[0]]
> Out[1]:= {1, 2, 3, 4, 5}
>
> Shouldn't this return {1, 3, 5}, since these are the corresponding elements that match Except[0]?
>

Hi,

  the whole list {9, 0, 7, 0, 6} is unequal to the Integer 0.

What you want is:

Pick[{1, 2, 3, 4, 5}, {9, 0, 7, 0, 6}, Except[0, _Integer]]

Cheers,
  Peter



  • Prev by Date: How to make field lines in VectorPlot3D white
  • Next by Date: Re: NDSolve curve - obtain single value from curve at t:=d
  • Previous by thread: Re: How to use Pick[]; Is this a bug?
  • Next by thread: Re: How to use Pick[]; Is this a bug?