Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

NumPy unique Syntax

numpy.unique(arr, return_index=False, return_inverse=False, return_counts=False, axis=None)
Comment

NumPy unique Example Get unique values from a 1D Numpy array

# welcome to softhunt.net
import numpy as np

duplicates = np.array([2,3,3,4,5,5,1,5,4,6,7,5,1,5,3,5,1,3])

# GET UNIQUE VALUES
ans = np.unique(duplicates)
print(ans)
Comment

numpy unique axis

#As of NumPy 1.13, one can simply choose the axis for selection of unique values in any N-dim array. To get unique rows, one can do:
import numpy as np
unique_rows = np.unique(original_array, axis=0)
Comment

np.unique

np.unique([1.2, 1.20, 1.200, 1.2000]) 

#output
#array([1.2])
Comment

PREVIOUS NEXT
Code Example
Python :: how to add two matrix using function in python 
Python :: np.random 
Python :: train split 
Python :: python library to make qr codes 
Python :: python send image in post request with json data 
Python :: try except keyerror 
Python :: python substitute multiple letters 
Python :: convert string of list to list python 
Python :: create dictionary from keys and values python 
Python :: basic tkinter window 
Python :: how explode by using two columns pandas 
Python :: discord.py say something 
Python :: django reverse queryset 
Python :: how to remove a string inside another string python 
Python :: Export a Pandas dataframe as a table image 
Python :: python turtle get mouse position 
Python :: remove duplicate columns python dataframe 
Python :: tkinter get child in frame 
Python :: chr() python 
Python :: find sum of 2 numbers in array using python 
Python :: zscore python 
Python :: python do while 
Python :: How to colour a specific cell in pandas dataframe 
Python :: extract zip file in python zipfile 
Python :: create pdf from bytes python 
Python :: google text to speech python 
Python :: loop through list of dictionaries python 
Python :: count a newline in string python 
Python :: python input timeout 
Python :: Using python permutations function on a list 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =