I\'ve got a large set of data points (100,000+) stored in a 2-dimensional numpy array (1st column: x coordinates, 2nd column: y coordinates). I\'ve also got several 1-dimensiona
Use matplotlib.nxutils.points_inside_poly, which implements a very efficient test.
Examples and further explanation of this 40-year-old algorithm at the matplotlib FAQ.
Update: Note that points_inside_poly
is deprecated since version 1.2.0 of matplotlib. Use matplotlib.path.Path.contains_points instead.