# Questions tagged as 'numpy'

1

## Obtain opposite polynomial

I know it can be silly but I can not find how to do it. I want to know how I can calculate the opposite polynomial created in Numpy regardless of its degree . Example that does not work for me: import numpy as np p0 = np.poly1d([2., 0.,...
1

## matrix edition

I am writing a program that I read a matrix and if the value of the element is less than a value rewrite it as zero and if it is greater than the value, leave it as such. I do this: lis=open('ej.txt','r') A=lis.read() A=np.genfromtxt(StringIO(...
1

## Create and plot fix of slopes between points

Good afternoon everyone, I'm trying to create an array with numpy that contains the slope between each of the points made with the arrays x e y to finally graph them with matplotlib . These are the steps that I am c...
3

## How to iterate in a dataframe for a certain number of rows?

I have the following dataframe: import pandas as pd import numpy as np data = pd.date_range('20180101', periods=300) df = pd.DataFrame(np.random.randn(300, 5), index=data, columns=['open', 'high', 'low', 'close', 'volume']) I...
1

## Difference between numpy.empty and numpy.array

np.empty is considered a junk vector in which it serves to know what type of data contains the vector and a np.array returns an array, but in which case it is more convenient to use each of them.
1

## matrix staggering in python

I have problems when trying to stagger a 5x5 matrix. First I made a null line go to the last row of the matrix (it worked), then I tried to make a row with the highest index fall below the one with the lowest index, but on the line: if pivos_i...
1

## Create an executable from a python script (NumPy)

Sorry that seems like a very simple doubt, but it is the first time that I do this and I am having difficulties. I have created with spyder, a software that brings anaconda, a calculator of systems of equations, in which I have used the numpy mo...
2

## Compare a coordinate list with another and its radius

Good! Let's see I have a function that generates a list ( List A ) of coordinates in numpy .    [[1,1][1,6][3,5][5,7]] < - (for example) And I have another list ( B list ) with more coordinates (Also in numpy ) format...
1