Questions tagged as 'numpy'

1
answer

Error in inRange () "TypeError: unknown is not a numpy array"

I am doing a motion detector program but I have an error in the following part of the code: rang = cv2.inRange(flow,20,255) Error: TypeError: <unknown> is not a numpy array Annex code: import cv2 import numpy as np cap = cv2...
asked by 26.03.2017 / 11:32
1
answer

Python Opencv + Gdal

I am developing software to calculate NDVI. What is NDVI? is a mathematical calculation with which you can determine the level of vegetation stress NDVI = NIR-RED / NIR + RED This result varies from -1 to 1 I'm using OpenCV as a library for arti...
asked by 01.08.2016 / 06:36
3
answers

Interactive Mode V / S Ide Python

One question; Why do I do this in interactive mode from python and from "spyder / ninja" does not work? Python »> from numpy import * »> a = array([10,20,30,40]) »> append(a,50) array([10, 20, 30, 40, 50]) »> Spy...
asked by 21.06.2016 / 00:14
2
answers

how to calculate time difference between two clients

How can I calculate the time difference between a client's actions? I want to calculate all the elapsed time of the users until it passes to the next user. example .... from user 1 to two it was 2 days 4 hours, 5 seconds. This is the dataf...
asked by 22.11.2018 / 20:25
1
answer

Save image to disk from a NumPy array

I have the following exercise:    a. Write a function that implements the gamma transformation of a grayscale image. The    function must receive as input parameters: a grayscale image (uint8) and the parameter    gamma. The output parameter...
asked by 27.08.2018 / 15:32
3
answers

Python copying a column from a .txt to a .csv, problems with decimals

I'm creating a numpy array called a table, in the fifth column I want to save a list of numbers that I have in a .txt file I do it with the following code: tabla[:, 4] = np.fromfile('/home/lucia/Documentos/Base de datos de imagenes/TID2013/...
asked by 09.06.2017 / 22:00
2
answers

Error with arrays in Python

I am trying to obtain the determinant of a matrix with the help of numpy.linalg.det (matrix) this is the code: from sympy import * #from numpy import * import numpy as np from matplotlib import * from py_expression_eval import * import matplot...
asked by 06.05.2017 / 17:58
1
answer

Multiply the same Matrix by N times

I am trying to multiply a matrix using numpy by itself N times, this is my current code import numpy as np fil1=3 col1=2 mat1 = random.random((fil1,col1)) mat3 = np.zeros((fil1,col1)) iter = 2 print('Matriz A:\n',mat1) for r in range(0,fil1)...
asked by 25.09.2018 / 08:27
1
answer

Integrals defined in python - Area under standard normal curve

I have two arrays with values x and y, "x" (value of random variable) are input values, and "y" are values calculated as a function of x (normal probability density function for x). How can I calculate the integral of "y" for a range of values i...
asked by 28.05.2018 / 16:13
2
answers

How to read a CSV file in Python and extract the maximum and minimum value per minute?

I used this code to extract the data from a CSV file, filter it and even organize it per minute, but I would like your help to create a cycle that allows me to update the information per minute, determining the maximum and the minimum value. i...
asked by 29.01.2018 / 06:17