I was doing an rc static analysis in openseespy module, I imported Geometry to pandas dataframe and then I converted it to numpy int , but I got an error. After some time I found np.int_ and python int are not quite the same. Woosh, I guess you learn a little everyday.
Code: Select all
#Vigas
data2= pd.read_excel('data.xlsx',sheet_name='elementos')
vigas=data2.to_numpy(dtype=np.int_)
print(type(vigas[0][0]))
print(type(int(vigas[0][0])))
for idx, vigai in enumerate(vigas):
ops.element('elasticBeamColumn',idx+37,vigas[idx][0],int(vigas[idx][1]),Av,E,G,Jxxv,Iyv,Izv,BTransform,'-mass',ρ*Av*10**-8)
Lesson of the day:
1) If docs says int , it really means int (int python type not numpy int) and nothing more
See ya folks, until next time