Skip to content
New issue

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

Question # 35 #194

Open
areeb-h-qureshi opened this issue Jan 23, 2023 · 1 comment
Open

Question # 35 #194

areeb-h-qureshi opened this issue Jan 23, 2023 · 1 comment

Comments

@areeb-h-qureshi
Copy link

With new casting rules, input arrays must be specified as a float inorder for np.divide to work. Otherwise casting of np.divide must be set to 'unsafe'

A = np.ones(3)*1
A.astype('float') # Possible fix
B = np.ones(3)*2
B.astype('float') # Possible fix

np.divide(A,2,out=A, casting='unsafe') # Alternative Fix

@rougier
Copy link
Owner

rougier commented Feb 2, 2023

Even with strict casting rules, all arrays are float arrays so I don't understand why np.divide would complain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants