
Dear sir, I have a numpy array,,. in which i have to choose only different values only, For example Let A= [ 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25.] then the answer is [20, 21. 22. 23. 24. 25.] ie choose only different values Please help me. -- DILEEPKUMAR. R J R F, IIT DELHI

On Fri, Mar 25, 2011 at 05:28:50PM +0530, dileep kunjaai wrote:
Dear sir, I have a numpy array,,. in which i have to choose only different values only, For example
Let A= [ 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25.] then the answer is [20, 21. 22. 23. 24. 25.] ie choose only different values
Try the numpy.unique function:
numpy.unique(A) array([20, 21. 22. 23. 24. 25.])
Miguel

Thank you sir,,,,,,, Thank you very much..... On Fri, Mar 25, 2011 at 5:32 PM, Miguel de Val-Borro <miguel.deval@gmail.com
wrote:
On Fri, Mar 25, 2011 at 05:28:50PM +0530, dileep kunjaai wrote:
Dear sir, I have a numpy array,,. in which i have to choose only different values only, For example
Let A= [ 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25. 20. 21. 22. 23. 24. 25.] then the answer is [20, 21. 22. 23. 24. 25.] ie choose only different values
Try the numpy.unique function:
numpy.unique(A) array([20, 21. 22. 23. 24. 25.])
Miguel _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- DILEEPKUMAR. R J R F, IIT DELHI
participants (2)
-
dileep kunjaai
-
Miguel de Val-Borro