only length-1 arrays can be converted to Python scalars using int function
Question: I currently got an array in python which is an element of a dictionary and, in
python console, looks like this:

    
    
    TUMEC['spans'][0]
    array([0. , 0.25, 0.5, 0.75, 1.])
    

I want to pass the whole array to a function but this has to go through some
simple math operation like:

    
    
    int(TUMEC['spans'][0]*100)
    

but I got the error message saying: only length-1 arrays can be converted to
Python scalars.

So, I tried to `import numpy` and type:

    
    
    int(TUMEC['spans'][0]*100)
    

but I still have the same issue.

Does anybody know how I can bypass this issue.


Answer: you can try converting to list and then comprehension :

    
    
    [int(a*100) for a in list(TUMEC['spans'][0])]
    

