This should do it:
c = [x[0] for x in A]
It’s a list comprehension that takes the first (sub-)element of every element of A
.
More Related Contents:
- How do I profile a Python script?
- What is the most “pythonic” way to iterate over a list in chunks?
- Fastest way to check if a value exists in a list
- Get difference between two lists
- Python Sets vs Lists
- Are tuples more efficient than lists in Python?
- Flatten an irregular list of lists
- Replace values in list using Python [duplicate]
- Why is [] faster than list()?
- How to iterate over a list in chunks
- What is the time complexity of popping elements from list in Python?
- Python – How to check list monotonicity
- [] and {} vs list() and dict(), which is better?
- Tuple or list when using ‘in’ in an ‘if’ clause?
- Why is tuple faster than list in Python?
- Complexity of list.index(x) in Python
- Efficient way to take the minimum/maximum n values and indices from a matrix using NumPy
- Python: get a dict from a list based on something inside the dict
- Create random list of integers in Python
- Flatten an irregular (arbitrarily nested) list of lists
- Creating an empty list in Python
- Get difference between two lists with Unique Entries
- Is there a way to circumvent Python list.append() becoming progressively slower in a loop as the list grows?
- sum each value in a list of tuples
- Python List Indexing Efficiency
- Python: iterating over list vs over dict items efficiency
- Looking for a fast way to find the polygon a point belongs to using Shapely
- Which is the most efficient way to iterate through a list in python?
- Length of longest word in a list
- deque.popleft() and list.pop(0). Is there performance difference?