Closed jze closed 7 years ago
Please do not start using the pylab
interface again.
Thanks for reporting and sorry for the regression.
IIUC, pylab.find
does this:
def find(condition):
"Return the indices where ravel(condition) is true"
res, = np.nonzero(np.ravel(condition))
return res
Does s,np.find/np.nonzero(np.ravel,
fix the issue?
Yes, it also works without pylab.
LGTM, thank you.
@zuphilip In https://github.com/tmbdev/ocropy/commit/a154e6360cd8e15c8c7cd5c2ce225c0ebed9d424 this was the only place where pylab.find was replaced by np.where, right?
@jze If you provide the source images and CLI invocation, we could add a test to prevent this kind of error in the future
In a154e63 this was the only place where pylab.find was replaced by np.where, right?
Yes.
Merged. Thank you very much @jze for the work and everybody here for the discussion!
I looks as if pylab.find and np.where work slightly different.