| | I have two arrays, a1 and a2. Assume len(a2) >> len(a1), and that a1 is a subset of a2.
I would like a quick way to return the a2 indices of ... | I have a numpy array with positive and negative values in.
a = array([1,1,-1,-2,-3,4,5])
I want to create another array which contains a value at each index where a sign change occurs (For ... | This is a really simple question, but I didnt find the answer.
How to call an element in an numpy array?
import numpy as np
arr = np.array([[1,2,3,4,5],[6,7,8,9,10]])
print arr(1,1)
The code above doesnt work.
| Let say that we have an array
a = np.array([10,30,50, 20, 10, 90, 0, 25])
The pseudo code for what I want -
if a[x] > 80 then perform funcA on a[x]
if 40 < ...
| Is there an easy way to take the dot product of one element of an array with every other?
So given:
array([[1, 2, 3],
[4, 5, 6],
...
| Hey.. I have run into a bit of a problem with my python code.. I have a set of values each for frequency and power-spectrum. I need to plot frequency v/s ... | I have a 2 dimensional NumPy array. I know how to get the maximum values over axes:
>>> a = array([[1,2,3],[4,3,1]])
>>> amax(a,axis=0)
array([4, 3, 3])
How can I get the indices of the maximum ... | | Out of curiosity, is there a specific numpy function to do the following (which would supposedly be faster):
a = np.array((0,2,4))
b = np.zeros(len(a) - 1)
for i in range(len(b)):
b[i] ...
| I'm experiencing a problem with array indexing. Suppose you have an array a and another array b you want to use to use as index for a in order to assign ... | I have a numpy array and I want to force every element that is less than zero to be zero and every element above 255 will be forced down to 255.
eg. ... | I have a numpy array containing:
[1, 2, 3]
I want to create an array containing:
[1, 2, 3, 1]
That is, I want to add the first element on to the end of the ... | I want to get the neighbors of the certain element in the numpy array. Lets consider following example
a = numpy.array([0,1,2,3,4,5,6,7,8,9])
So I want to specify position 5 and ... |
|