[SciPy-User] Extract a segment from a 2D array

Xavier Gnata xavier.gnata at gmail.com
Sun Jan 23 18:02:38 EST 2011


Hi,

Let's take an example:
I have a 100x100 2D array.
I want to extract all the values on a segment starting at (10,12) and 
ending at (42,42) and put them in a 1D array.
Of course I can code the type Bresenham's line algorithm but I think I 
reinventing the wheel.
What's the scipy way to deal with that? (If needed, I can use matplotlib)


@+,
Xavier




More information about the SciPy-User mailing list