About 10,100,000 results
Open links in new tab
  1. numpy.uniqueNumPy v2.2 Manual

    Find the unique elements of an array. Returns the sorted unique elements of an array. There are three optional outputs in addition to the unique elements: the indices of the input array that …

  2. python - How do I count occurrence of unique values inside a list ...

    Sep 5, 2012 · For ndarray there is a numpy method called unique: np.unique(array_name) Examples: >>> np.unique([1, 1, 2, 2, 3, 3]) array([1, 2, 3]) >>> a = np.array([[1, 1], [2, 3]]) >>> …

  3. Get Unique Values from a List in Python - GeeksforGeeks

    May 8, 2025 · Getting unique values from a list in Python allows you to remove duplicates and work with distinct elements. For example, given the list a = [1, 2, 1, 1, 3, 4, 3, 3, 5], you might …

  4. Python Unique List – How to Get all the Unique Values in a List or Array

    Aug 17, 2020 · But you want a list of unique numbers. unique_numbers = [1, 2, 3, 4] There are a few ways to get a list of unique values in Python. This article will show you how. Option 1 – …

  5. How to find unique numbers in an array in Python - CodeSpeedy

    Jun 29, 2019 · Here we can learn how to find unique numbers of the array in two ways. 1.Using set keyword. 2.Using conditional statements. By using set function we can find the unique …

  6. NumPy Unique Function in Python - Python Guides

    May 8, 2025 · In this tutorial, I’ll show you how to use NumPy’s unique function to find distinct elements in arrays efficiently. I’ll cover different use cases and practical examples that you can …

  7. Python Program to Find Unique Items in an Array - Tutorial …

    Write Python Program to Find and Print the Unique Items in an Array. The unique function in the Numpy module returns the unique array of items. And this example uses that function to return …

  8. 8 Ways in Python to Count Unique Values in List

    Mar 17, 2021 · Let us understand the all the different methods through which we can calculate the count of unique elements in the list or an array with the help of examples: Python Count …

  9. 5 Best Ways to Find Unique Values in a Python NumPy Array

    Feb 20, 2024 · For instance, given an input array [1, 2, 2, 3, 3, 3, 4, 5, 5, 5], the desired output is a new array containing the unique values [1, 2, 3, 4, 5]. This article demonstrates five methods …

  10. NumPy: How to find unique elements in an array - Sling Academy

    Jan 23, 2024 · The most straightforward way to find unique elements in a NumPy array is to use the np.unique() function. Here is a basic example: # Create a numpy array . # Find the unique …

Refresh