We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm facing issues with the below code -
def function_2(seq, sub): target = np.dot(sub, sub) candidates = np.where(np.correlate(seq, sub, mode='valid') == target)[0] check = candidates[:, np.newaxis] + np.arange(len(sub)) mask = np.all((np.take(seq, check) == sub), axis=-1) return candidates[mask] function_2('shasdefiran','def') --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-69-3a3e84d6ff06> in <module> ----> 1 function_2('shasdefiran','def') <ipython-input-64-dc47768a25a7> in function_2(seq, sub) 1 def function_2(seq, sub): ----> 2 target = np.dot(sub, sub) 3 candidates = np.where(np.correlate(seq, sub, mode='valid') == target)[0] 4 check = candidates[:, np.newaxis] + np.arange(len(sub)) 5 mask = np.all((np.take(seq, check) == sub), axis=-1) TypeError: ufunc 'multiply' did not contain a loop with signature matching types dtype('<U3') dtype('<U3') dtype('<U3')
Please help me understand the issue with the above code.
The text was updated successfully, but these errors were encountered:
Can you test only the np.dot(sub,sub) call ? (and give here how do you generate the sub)
np.dot(sub,sub)
sub
Sorry, something went wrong.
No branches or pull requests
I'm facing issues with the below code -
Please help me understand the issue with the above code.
The text was updated successfully, but these errors were encountered: