I have in mind that 'np.count_nonzero' is somewhat of a recent addition to numpy. You may want to check if it is in all the versions of numpy that we support.