Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

unique lits on python

my_list  = [1,1,2,3,2,1,5]

# A set contains unique elements of which the order is not important
unique = list(set(my_list))

print(unique)
# Important: initial order might not be respected
# Output: [1,3,2,5]
Comment

PREVIOUS NEXT
Code Example
Python :: prolog split list positive negative 
Python :: python get text that is already printed 
Python :: python set vs tuple performance 
Python :: Python slides 
Python :: python coding questions for data science 
Python :: python create empty list with size 
Python :: uncompress zip file in pythonanywhere 
Python :: python jupyter show cell execution progress bar 
Python :: Annotation graphique python 
Python :: python subprocess call with no environment variable 
Python :: Python NumPy broadcast_arrays() Function Syntax 
Python :: Python NumPy moveaxis function Example 02 
Python :: python terminal color 
Python :: kaggle replace 
Python :: Python NumPy asarray_chkfinite Function Example List to an array 
Python :: django on-delete options 
Python :: How can Clone or Duplicate a Row Using np.tile 
Python :: add text to pdf file in python 
Python :: modles en django 
Python :: 16. count total numbers of uppercase and lowercase characters in input string python 
Python :: NumPy unpackbits Syntax 
Python :: qt list widget let editable 
Python :: how to calculate iqr in pandas 
Python :: celery 5.2.3 decorators 
Python :: How to use a <ComboboxSelected virtual event with tkinter 
Python :: how to check all possible combinations algorithm python 
Python :: pyxl activate sheet 
Python :: HTML default value fo radio button input type based on python variable 
Python :: how to make a typing effect in python 
Python :: knn.score sklearn 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =