How to Indexing the data of a list with respect to the unique ordered data.

jospercomp shared this question 2 years ago
Answered

l1={2,5,2,-1,2}

l2=Unique(l1)


l2={-1,2,5}

l2index={1,2,3}

index={2,3,2,1,2}

Best Answer
photo

index = Sequence(IndexOf(l1(n), l2), n, 1, Length(l1))

index = Zip(IndexOf(z,l2),z,l1)

Comments (4)

photo
2

index = Sequence(IndexOf(l1(n), l2), n, 1, Length(l1))

index = Zip(IndexOf(z,l2),z,l1)

photo
1

Thank you so much!!!

photo
1

LT={"Mínimo", "Medio", "Máximo"}

Sequence(Element(LT, Element(index, i)), i, 1, Length(index))

photo
photo
2

Zip(CountIf(a < b, a, l2), b, l1) + 1

© 2023 International GeoGebra Institute