[Numpy-discussion] numpy.ma.flatnotmasked_contiguous error in slice.stop values?
Geordie McBain
gdmcbain at freeshell.org
Sun Aug 8 23:54:32 EDT 2010
2010/8/9 Pierre GM <pgmdevlist at gmail.com>:
> OK, mind opening a ticket ? I'll try to take care of that tmw and I don't want the bug report to fall between the cracks.
Done. http://projects.scipy.org/numpy/ticket/1576. Thank you for your
very prompt and helpful response. I wasn't aware of the ticket system
previously.
> Mmh, tuples are nicer than slices... We'll see.
O.K. I'm fairly new to NumPy and Matplotlib, so I'll leave the design
decision to the experts, but I did find
segments = np.ma.flatnotmasked_contiguous (am)
print am[segments[0]], am[segments[1]]
easier than
segments1 = matplotlib.mlab.contiguous_regions (am)
print am[slice (*segments1[0])], am[slice (*segments1[1])]
but perhaps there are more elegant ways of dealing with tuples
representing slices?
> print numpy.version.version
Thanks.
More information about the NumPy-Discussion
mailing list