Post Closed as "duplicate" by Mr.Wizard list-manipulation of
2 Improved formatting.
source | link

`Position` Position with test for list of lists

Why do I get this error message? It seems to me that the level specification should have done the job.

   In[364]In[1]:= RandomInteger[10, {10, 2}]
   In[2]:= Position[%, _?(#[[1]] > 5 &), {1}] 

    Out[364]=Out[1]:= {{0, 0}, {1, 7}, {3, 0}, {5, 5}, {1, 5}, {10, 6}, {3, 
      9}, \
{0, 1}, {9, 1}, {2, 0}}
 
    During evaluation of In[364]

During evaluation of In[2]:= Part::partd: Part specification List[[1]] is longer than depth of object. >>

Out[2]:= Part::partd: Part specification List[[1]] is longer than depth of object. >>

    Out[365]= {{6}, {9}}

`Position` with test for list of lists

Why do I get this error message? It seems to me that the level specification should have done the job.

   In[364]:= RandomInteger[10, {10, 2}]
    Position[%, _?(#[[1]] > 5 &), {1}]

    Out[364]= {{0, 0}, {1, 7}, {3, 0}, {5, 5}, {1, 5}, {10, 6}, {3, 
      9}, {0, 1}, {9, 1}, {2, 0}}
 
    During evaluation of In[364]:= Part::partd: Part specification List[[1]] is longer than depth of object. >>

    Out[365]= {{6}, {9}}

Position with test for list of lists

Why do I get this error message? It seems to me that the level specification should have done the job.

In[1]:= RandomInteger[10, {10, 2}]
In[2]:= Position[%, _?(#[[1]] > 5 &), {1}] 

Out[1]:= {{0, 0}, {1, 7}, {3, 0}, {5, 5}, {1, 5}, {10, 6}, {3, 9}, \
{0, 1}, {9, 1}, {2, 0}}

During evaluation of In[2]:= Part::partd: Part specification List[[1]] is longer than depth of object. >>

Out[2]:= {{6}, {9}}
    Tweeted twitter.com/StackMma/status/691834097778429956
1
source | link

`Position` with test for list of lists

Why do I get this error message? It seems to me that the level specification should have done the job.

   In[364]:= RandomInteger[10, {10, 2}]
    Position[%, _?(#[[1]] > 5 &), {1}]

    Out[364]= {{0, 0}, {1, 7}, {3, 0}, {5, 5}, {1, 5}, {10, 6}, {3, 
      9}, {0, 1}, {9, 1}, {2, 0}}

    During evaluation of In[364]:= Part::partd: Part specification List[[1]] is longer than depth of object. >>

    Out[365]= {{6}, {9}}