Isolating the index of a number in a list
Roguebantha 12 Sep 2013 12:44
This is a routine I've been searching for/working on for awhile. A function that given a number, it searches the list for that number and returns the index at which it finds it. Today I pulled it off by using cumSum:
1+sum(not(cumSum(L1=X)))
Given a value in X, that method will search L1 and return the index of the first occurrence of X. If the value of X is not in L1, it returns one greater than the size of L1. I hope that helps someone out :)