Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #14992
| From | Adriano Pascoletti <adriano.pascoletti@uniud.it> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: bug or feature ? |
| Date | 2013-06-24 07:52 +0000 |
| Message-ID | <kq8tsj$8p0$1@smc.vnet.net> (permalink) |
| References | <20130624025718.E40906A07@smc.vnet.net> |
| Organization | Time-Warner Telecom |
Add the option Heads->False (see documentation to Position, details and
options)
In[6]:= Position[{{1, 2}, {2, 3}, {1, 4}}, _?(EvenQ[#1[[2]]] & ), {1},
Heads -> False]
Out[6]= {{1}, {3}}
Adriano Pascoletti
2013/6/24 roby <roby.nowak@gmail.com>
> Dear Group
>
> When trying to evaluate the following code the expected result is returned.
> But strangly there is an error message generated.
> The code should (and does) return the positions of all sublists with an
> even element at the second position.
>
>
>
> Position[{{1, 2}, {2, 3}, {1, 4}}, _?(EvenQ[#[[2]]] &), {1}]
>
> Part::partd: Part specification List[[2]] is longer than depth of object.
> >>
>
> {{1}, {3}}
>
>
>
> Any hints if this a bug or a feature ?
>
> Regards Robert
>
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar
Re: bug or feature ? Adriano Pascoletti <adriano.pascoletti@uniud.it> - 2013-06-24 07:52 +0000
csiph-web