Suppose we have a list given below
OurList={a,b,c,d,e}
Is there a way to attribute a number to each element of OurList so that we could form a table of points? The expected result is
OutTable={{1,a},{2,b},{3,c},{4,d},{5,e}}
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityThere are may be 10 others ways to do this, but this is good problem for using MapIndexed
lis = {a, b, c, d, e}
MapIndexed[{First[#2], #1} &, lis]
MapIndexed[{2*First[#2], #1} &, lis]
Transpose[{Range[1, Length@ourList], ourList}]
. Please do not start variable names with uppercase characters. ORThread[{Range[1, Length@#], #}] &@ourList
$\endgroup$List Manipulation
$\endgroup$