Mathematical Operations on Array
tjreedy at udel.edu
Fri Apr 1 21:45:24 CEST 2011
On 4/1/2011 8:56 AM, Fodness, Bryan C - GS wrote:
> I am loading text into an array and would like to convert the values.
> from math import *
> from numpy import *
> from pylab import *
> I am not sure why degrees() works, but acos() does not.
It is not clear how you know that.
> I receive the following
> Traceback (most recent call last):
> File "C:\ test.py", line 6, in ?
> TypeError: only length-1 arrays can be converted to Python scalars
This does not say where in the expression the problem arose. to be sure
a = float(data([:,0])
b = acod(a)
c = degrees(b)
> Can anyone tell me what I am doing wrong?
Numpy questions get better answers on the numpy list where numpy experts
Terry Jan Reedy
More information about the Python-list