# unique « numpy « Python Data Type Q&A

Home
Python Data Type Q&A
 1 array 2 date 3 dictionary 4 Format 5 integer 6 List 7 numpy 8 regex 9 string 10 tuple
 Python Data Type Q&A » numpy » unique

### 1. Finding a list of indices from master array using secondary array with non-unique entries    stackoverflow.com

I have a master array of length n of id numbers that apply to other analogous arrays with corresponding data for elements in my simulation that belong to those id numbers ...

### 2. Efficient way to count unique elements in array in numpy/scipy in Python    stackoverflow.com

I have a scipy array, e.g.

``````a = array([[0, 0, 1], [1, 1, 1], [1, 1, 1], [1, 0, 1]])
``````
I want to count the number of occurrences of each unique element in ...

### 3. Find unique elements of floating point array in numpy (with comparison using a delta value)    stackoverflow.com

I've got a `ndarray` of floating point values in numpy and I want to find the unique values of this array. Of course, this has problems because of floating point accuracy...so ...

### 4. How to select all locations of unique elements in numpy 2d array with bounding box around them?    stackoverflow.com

I have a 2D numpy array I want to find the 'every' location of all the unique elements. We can find the unique elements using `numpy.unique(numpyarray.)`. Here it comes the tricky ...

### 5. how to fill the start and the end of a unique entry with the same value in numpy array?    stackoverflow.com

i have a 1D numpy array. Lets look at the following example

``````a = [255,1,255,255,1,255,255,255,2,2,255,255,255,2,2,3,255,255,255,3]
``````
In the above array the unique entries are considered except the value which is 255. We want to ...

### 6. Finding unique points in numpy array    stackoverflow.com

What is a faster way of finding unique x,y points (removing duplicates) in a numpy array like:

``````points = numpy.random.randint(0, 5, (10,2))
``````
I thought of converting points to a complex numbers and then ...

### 7. Better way to find existence of arrays in list of arrays    stackoverflow.com

I am a newbie to Python and trying out different ways to optimize and simplify my code. I have a list of arrays(necessarily in this format) initially empty, which I need to ...

### 8. Unique numpy arrays    python-forum.org

Hello all, I would be grateful for your advice regarding something I tried to do using unique() but it didn't work. I have a two dimensional numpy array that looks like that (but much larger): >>> pop_A1 array([[10, 2, 10], [10, 9, 10], [10, 9, 10], [10, 9, 10], [10, 9, 10], [22, 9, 10], [10, 9, 10], [10, 9, 10], ...