Questions tagged as 'numpy'

3
answers

Multiply matrices in python

This is a question a bit simple but I can not solve it on my own, and I have not found any post related to this topic, my question is this: matriz=[[1,1,1],[1,1,1],[1,1,1]] print(matriz) matriz[0]=matriz[0]*2 print(matriz) What I want to...
asked by 21.05.2018 / 22:37
1
answer

how to get the largest item in each row with numpy?

I try to get a list of the indexes of the largest elements in each row a = np.arange(16).reshape((4, 4)) print(a) print(np.amax(a, axis=1)) print(np.where(a == np.amax(a, axis=1))) this is the result: I get the largest matrix wher...
asked by 20.11.2017 / 05:33
1
answer

Add all the values and add the value at the end

I have the following code in Python: import numpy as np from math import pi t = np.linspace(-2*pi,2*pi,16300) #Creo un vector de 16300 puntos de -2*pi a 2*pi x = np.sinc(t) print(x) I want to algebraically add all the points of x and add t...
asked by 25.07.2017 / 20:38
2
answers

Problem in assigning arrays in Python

Hello, I do not know if this question has already been answered, but my problem is this: When assigning a global variable to a local variable of a class, changing the value of the local variable also modifies the value of the global v...
asked by 06.08.2017 / 18:31
1
answer

Problem installing Mayavi 4.5 in Python 3

I can not install Mayavi 4.5 correctly on Python 3. I have a full installation of Anaconda (the 64-bit version) on Python 3.5 and I installed Mayavi via: conda install -c menpo mayavi=4.5.0. The moment I try to load the library, I get the...
asked by 04.09.2016 / 18:50
1
answer

Replace values from a list in an array in Python

My problem is this, I want to replace a list of questions in the first row of a square null matrix leaving the first zero, that is, if the matrix is m rows by n columns, I would like to insert the list of questions to from the value [m, n] = [0,...
asked by 19.05.2018 / 06:15
1
answer

Drawing in OpenCV and Python

I'm doing an application in Python, which using the OpenCV library and passing it the height and width, I create a RGB image with the past dimensions and in which I can draw and gurantee later. I'm trying something like this: import numpy a...
asked by 21.02.2018 / 17:56
1
answer

Problem removing elements from an array: "can not delete array elements"

I have a problem to which I can not find a solution for more laps I give it. I have a program in which I generate a series of data and store them in a list. Later I have to remove some of the elements from the list so that its size is smaller. I...
asked by 22.11.2017 / 11:21
1
answer

error with matrix in python (method of gauss-jordan) (numpy)

Good day estimated, implement the gauss-jordan method in python in the following way and it is working: #La idea de este metodo es que el usuario ingrese una matriz MxM y un vector de tamano M import numpy def gaussJordan(m): #creamos una...
asked by 30.05.2017 / 12:33
1
answer

Get the positions of the array where you find a value with numpy.where

I have an array of the form: array = ['A', 'D', 'A', 'A', 'A', 'D', 'A', 'A', 'D', 'A'] And I need to get the positions of the array where I find 'D' . What I'm trying to do is: d_pos[numpy.where(array == 'D')] But I get the foll...
asked by 21.09.2016 / 20:34