def polygon_from_points ( points ) : polygon = [ ] for pair in points . split ( " " ) : x_y = pair . split ( "," ) polygon . append ( [ float ( x_y [ 0 ] ) , float ( x_y [ 1 ] ) ] ) return polygon
python how to make list of points
Constructs a numpy - compatible polygon from a page representation .
def polygon_from_points(points):
    """
    Constructs a numpy-compatible polygon from a page representation.
    """
    polygon = []
    for pair in points.split(" "):
        x_y = pair.split(",")
        polygon.append([float(x_y[0]), float(x_y[1])])
    return polygon