Given list such as [1,2,3,4,5,x,y,8,9,Pi] find position of elements that are not
numeric. In this case the answer should be [6,7,10]
restart; lis:=[1,2,3,4,5,x,y,8,9,Pi]; lis2:=select(x->not(type(x,numeric)),lis); map(x->ListTools:-Search(x,lis),lis2) [6,7,10]
I could not find a way to do it using one command like with Mathematica. The first
command above uses select to first find non numeric entries. The second command
ListTools:-Search then find the index/position.
Maple’s ListTools:-Search should really have a version that allows one to select the
element directly. Something like this