TypeError: 'numpy.float64' object can not be interpreted as an integer

0

I try to perform an arithmetic operation using values obtained from a DataFrame using statements df.loc[] . The sentence

beneficio = (cotz_fin - cotz_ini) * opcion 

produces the error:

  

"TypeError: 'numpy.float64' object can not be interpreted as an integer."

I have seen on the Internet and on this website ( link ), that the problem could be caused by "It is caused by unsupported float index in 1.12.0 and newer versions even if the code should be considered as valid.", recommending to install "An int type is expected , not to np.float64 Solution: Try to install numpy 1.11.0 ".

I have verified that in my anaconda3, I have version 1.13.3 of NumPy installed.

I have also verified that in my anaconda 3, the NumPy 1.11.0 package is not available to be installed ( conda search nombredelpaquete ).

At this point I am blocked. How can I remove the installed version numpy-1.13.3 and then install the version numpy-1.11.3 , inside Anaconda3 ?.

    
asked by efueyo 13.11.2017 в 14:50
source

1 answer

0

My inexperience induced me to make the mistake of not converting the variable "option" into "float", a number obtained through an "input" sentence. Rule for the future: first check the simplest and most basic code and do not rush into the text of the error,

    
answered by 22.11.2017 / 10:54
source