I would like to create a set composed of the numbers 2,3,4,...49,50,51. How
do i do?
Thanks.
--
View this message in context:
http://old.nabble.com/set-operation-tp29449267p29449267.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.
_
I have a numpy array A , such that when i print A it appears:
[[ 10.]
[ 20.]]
I would like to have a one dimensional array B (obtained from A) such that
B[0] = 10 and B[1]=20. It could be seen as the transpose of A.
How can i obtain B = [10,20] from A? I tried transpose(1,0) but it doesn't
se
As i wrote, the elements of each A[i][j] are sets and not numbers.
David Warde-Farley-2 wrote:
>
> On 2010-08-12, at 3:59 PM, gerardob wrote:
>
>>
>> Hello, this is a very basic question but i don't know the answer.
>>
>> I would like to construct a two
Hello, this is a very basic question but i don't know the answer.
I would like to construct a two dimensional array A, such that A[i][j]
contains a set of numbers associated to the pair (i,j). For example, A[i][j]
can be all the numbers that are written as i^n*j*5-n for some all n=1,..,5
Is nump
I have three lists of floats of equal lenght: upper_bound, lower_bound and x.
I would like to check whether lower_bound[i]<= x[i] <= upper_bound[i] for
all i in range(len(x))
Which is the best way to do this?
Thanks.
--
View this message in context:
http://old.nabble.com/check-for-inequalit
Hello, I have written a very simple code that computes the gradient by finite
differences of any general function. Keeping the same idea, I would like
modify the code using numpy to make it faster.
Any ideas?
Thanks.
def grad_finite_dif(self,x,user_data = None):
I installed scipy (and all the required libraries) and the following error
appears when i tried run a simple example which uses the optimize package of
scipy. I tried also numpy alone and it works ( at least for printing
numpy.array([10,20,10]))
error:
Traceback (most recent call last):
File "
Let A be a square matrix of 0's and 1's, and let X be a one dimesional
vector.
The length of X is equal to the number of 1's that A has.
I would like to produce a new matrix B by traversing the matrix A row by row
and:
1- whenever i find a 0, set B in that position to zero.
2- whenever i find a 1,
Hello, i would like to produce lists of lists 1's and 0's.
For example, to produce the list composed of:
L = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]
I just need to do the following:
n=4
numpy.eye(n,dtype=int).tolist()
I would like to know a simple way to generate a list containing all the
l
Let A and B be two n x n matrices.
I would like to have another n x n matrix C such that
C_ij = min {A_ij, B_ij}
Example:
A = numpy.array([[2,3],[10,12]])
B = numpy.array([[1,4],[9,13]])
Output
C = [[1,3],[9,12]]
The function min(axis) of numpy seems to be only unary.
Thanks.
--
View thi
How can i modified all the values of a numpy array whose value is smaller
than a given epsilon to zero?
Example
epsilon=0.01
a = [[0.003,2][23,0.0001]]
output:
[[0,2][23,0]]
--
View this message in context:
http://old.nabble.com/Setting-small-numbers-to-zero.-tp27933569p27933569.html
Sent f
11 matches
Mail list logo