Variable Size Array Matching
I have a data file which is sorted based on the first column 1 3 2 3 6 4 8 5 6 2 4 9 5 2 2 There is a key with three items, say seen = [4 8 5] that I want to search in the above a
Solution 1:
Using slice, you don't need to check all 3 items manually and check length:
take = [rowforrowin lines if row[:3] == seen]
Post a Comment for "Variable Size Array Matching"