ufunc 'multiply' did not contain a loop with signature matching types dtype('<U32') dtype('<U32') dtype('<U32')

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-14 02:46:11

问题


I'm trying to write this simple script but for some reason i'm struggling with the mathematical multiply operation. The error that I am getting is

ufunc 'multiply' did not contain a loop with signature matching types dtype('<U32') dtype('<U32') dtype('<U32')

I am using PyCharm for the first time as editor and I've never had this problem with jupiter.

This is my code

import numpy as np


polar_surfacetension = input('Enter the polar component of the surface tension in mN/m (46.4 for water): ')
polar_dispersive = input('Enter the dispersive component of the surface tension in mN/m (26.4 for water): ')
polar_angle = list()
print("Polar Solvent measurements")
num = input("Enter numbers of measurements performed :")
print('Enter angles values in degrees: ')
for i in range(int(num)):
    n = input("Value :")
    polar_angle.append(float(n))

non_polar_surfacetension = input('Enter the  non polar component of the surface tension in mN/m (50 for \
diiodomethane): ')

print("Non Polar Solvent measurements")
non_polar_angle = list()
num_2 = input("Enter numbers of measurements performed :")
print('Enter angles values in degrees: ')
for i in range(int(num_2)):
    n = input("Value :")
    non_polar_angle.append(float(n))

solid_dispersive = (((np.cos([non_polar_angle])+1)**2)*non_polar_surfacetension)/4

print (solid_dispersive)

Thank you!

来源:https://stackoverflow.com/questions/37751405/ufunc-multiply-did-not-contain-a-loop-with-signature-matching-types-dtypeu3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!