MathGroup Archive 2005

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

Search the Archive

Position function

suppose i have a List:
how i could know the positions of "1" in every sublist , i could use Position[a
[[1]],1] and Position[a[[2]],1]
but i want a one formula to give me {{1,3,5},{3,4,6}}

the second question:
using Position[a,1] will give:
{{1, 1}, {1, 3}, {1, 5}, {2, 3}, {2, 4}, {2, 6}}
in general how to extract only the second item from every sublist so the output 
will be;

  • Prev by Date: Re: MathLink and Python
  • Next by Date: Re: Simplifying ArcTan
  • Previous by thread: Re: how to make conditional summation
  • Next by thread: Re: Position function