Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

intersect in python list

>>> a = [1,2,3,4,5]
>>> b = [1,3,5,6]
>>> list(set(a) & set(b))
[1, 3, 5]
Comment

PREVIOUS NEXT
Code Example
Python :: check if host is reachable python 
Python :: ta-lib python install 
Python :: python to excel 
Python :: set value based on column 
Python :: flask error 
Python :: roman to integer python 
Python :: drop column from dataframe 
Python :: python data structures 9.4 
Python :: python get file name without dir 
Python :: python f string 
Python :: python bitwise operators 
Python :: pandas select a row 
Python :: Converting uint8 into integers 
Python :: numpy stack arrays vertically 
Python :: indentation levels in programming 
Python :: numpy array length 
Python :: tensor to int python 
Python :: flask quickstart 
Python :: number of unique pairs in columns pandas 
Python :: regular expression to remove space python 
Python :: python line_profiler 
Python :: python efficiently find duplicates in list 
Python :: create square matrix python 
Python :: logging - multiple log file 
Python :: generate unique id from given string python 
Python :: graph 3d python 
Python :: python access global variable 
Python :: how to play mp3 files using vlc python library 
Python :: python requests get 
Python :: python how to make notepad 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =