Try this:
def index_2d(myList, v):
for i, x in enumerate(myList):
if v in x:
return (i, x.index(v))
Usage:
>>> index_2d(myList, 3)
(1, 0)
More Related Contents:
- List of lists changes reflected across sublists unexpectedly
- Python append() vs. + operator on lists, why do these give different results?
- Flatten an irregular list of lists
- Function changes list values and not variable values in Python [duplicate]
- Split a list into nested lists on a value
- Generating sublists using multiplication ( * ) unexpected behavior [duplicate]
- why can’t I change only a single element in a nested list in Python [duplicate]
- Print list of lists in separate lines
- How to convert nested list of lists into a list of tuples in python 3.3?
- Replace list of list with “condensed” list of list while maintaining order
- Flatten an irregular (arbitrarily nested) list of lists
- Python: merge nested lists
- How to create a number of empty nested lists in python [duplicate]
- Extract first item of each sublist in Python
- Not sure how to tackle this [closed]
- How to make separator in pandas read_csv more flexible wrt whitespace, for irregular separators?
- Getting “Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?” when installing lxml through pip
- Handling urllib2’s timeout? – Python
- Matplotlib Plot Lines with Colors Through Colormap
- How to make a custom object iterable?
- How to use “raise” keyword in Python [duplicate]
- SqlAlchemy – Filtering by Relationship Attribute
- Processes stuck in loop with PyInstaller-executable
- Remove dictionary from list
- how to print chinese word in my code.. using python
- How to change the plot line color from blue to black?
- ModuleNotFoundError: No module named ‘requests’ after pip install [duplicate]
- Nested Loop Python
- Alternative to contextlib.nested with variable number of context managers
- find time shift between two similar waveforms