[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] array search



The problem at hand is "finding all indexes that are not 0", so you obviously do have to iterate through the whole array to find them... whether or not you explicitly use 'for' to do it.
	With large data sets, there can be a significant speed difference between 'for' and using map() or filter().

	The best option (if speed is paramount) is to pass the list to a custom C function that does the looping.  I have used SWIG to interface C to Python, and posters have mentioned other C-to-Python helpers on this list.


--Derek