Reputation: 47
I have an array defined in this way (extracting the third column of a dataset):
value=[]
value.append((p[3]))
x=np.array(value)
How can I do if I would like to obtain a new array containing the Log10 (o a different function) of the array x? I have tried with:
logx=np.array(log(x))
but it gives me the following error:
TypeError: 'numpy.ufunc' object is not subscriptable.
Where am I wrong?
Upvotes: 1
Views: 1536
Reputation: 3981
Not sure why Nikolay's answer isn't working for you, but you could also do:
logx = map(np.log, x)
Upvotes: 0