| 1 | initial version |
For example via list comprehension:
B = [A[i] for i in range(len(A)) if i==0 or A[i]!=A[i-1]]
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.