esto no responde a su pregunta gráfica, pero que sin duda puede aplicar una lista en Python 2D sin tener que recurrir a las listas de listas en por lo menos dos maneras:
puede simplemente usar un diccionario:
import collections
t = collections.defaultdict(int)
t[0, 5] = 9
print t[0, 5]
Esto también tiene la ventaja de que es escaso.
Para un enfoque más elegante, pero que requiere más trabajo, puede usar una lista 1d y calcular el índice utilizando las coordenadas 2D junto con el alto y el ancho de la tabla.
class Table(object):
def __init__(self, width, height):
self._table = [None,] * (width * height)
self._width = width
def __getitem__(self, coordinate):
if coordinate[0] >= width or coordinate[1] >= height:
raise IndexError('Index exceeded table dimensions')
if coordinate[0] < 0 or coordinate[1] < 0:
raise IndexError('Index must be non-negative')
return self._table[coordinate[1] * width + coordinate[0]]
def __setitem__(self, coordinate, value):
if coordinate[0] >= width or coordinate[1] >= height:
raise IndexError('Index exceeded table dimensions')
if coordinate[0] < 0 or coordinate[1] < 0:
raise IndexError('Index must be non-negative')
self._table[coordinate[1] * width + coordinate[0]] = value
t = Table(10,10)
t[0, 5] = 9
print t[0, 5]
¿Por qué una lista de listas no es Pythonic? Las listas 2D son bastante comunes en Python. También puede usar el [numpy.ndarray] (http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html), bien desarrollado, que implementa matrices n-dimensionales y admite la indexación por filas o por columna. –