I would like to get the number of different values found in a List.
For example:
The output for the List a={1,2,3,4,5} would be 5 whereas it would be 2 for b={1,1,1,2,2}.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just for amusement, all the following commands also give the desired result:
And many more, of course.
Edit
Here is a little timing experiment (not serious)
BTW: Note the difference between
BinLists[ ]andBinCounts[ ]Edit
A more detailed view of
DeleteDuplicatesvsTallyBeware! Log Plot!