Questions tagged [NumPy] (49)

0
answer

How to fix too much array?

There is an iteration algorithm table dataframe. Its purpose is to bypass all the lines and to the first row to add all the matching rows, the rows themselves to annihilate, and matching rows are rows in which every cell in the column "district" are the samedopIdx = 0 for row in dataFr['District']: if (dopIdx + 1) == len(d...
Emmie.Cartwright asked April 4th 20 at 12:55
1
answer

How to fix the error associated with path?

<i><b># The folder containing the input images. Change the folder for the required input image set inputFolder = "C:/Users/uno/PycharmProjects/LightFieldViewer/rectified/out_00_00_-780.134705_-3355.331299_"</b></i> # Deepak Ravindran # CS 6475 - Computational Photography # Georgia Institute of Tech...
Deborah_Jast asked April 4th 20 at 12:38
1
answer

How to use numpy array to filter on multiple conditions?

jj = np.array([[3, 4, 9], [5, 7, 4], [2, 5, 10]]) there are maybe like that filtranti by several conditions? well, for example: jj[:, 0]>2 & jj[:, 2]>5 and to get the output: [3, 4, 9]
webster.Torp asked April 4th 20 at 12:18
0
answer

PyQtGraph. How to store a large number of graph elements?

In the program of the coming data, one float and one datetime. Somewhere every 4 seconds. But it is somewhere around 20,000 a day and day not alone. float is recorded on a curve in the natural order of the parish. datetime should appear when you hover over the corresponding float. All this stuff should be monitored by the u...
Jean.Kihn41 asked April 4th 20 at 01:39
3
answers

How to quickly find an element in a 2d np array?

Have a 2d np array, for example, [[1, 2, 3], [1, 3, 2], [3, 3, 3]] you need to determine at what point is the internal array, let it be [1,3,2]
wilson.Kuh asked April 4th 20 at 01:32
2
answers

What is the error in the constructor Decimal()?

So my turn to ask stupid questions came up. Meditate on this:Code to reproduceimport numpy as np from decimal import Decimal t = tuple(np.square(Decimal(123).as_tuple().digits)) assert t == (1, 4, 9) assert type(t) is tuple assert type(t) == type((1, 4, 9)) Decimal((0, (1, 4, 9), 0)) Decimal((0, t, 0)) What's the catch?
Rosalinda_Volkman asked April 4th 20 at 01:29
2
answers

How to count the number of identical elements in a multidimensional array?

There is a multidimensional array filled with zeros using np.zeros. There is a function which modifies it randomly zeros and ones. How to count the number of units in the changed array ?
Kaylie.Little asked April 2nd 20 at 16:31
1
answer

Why the formula is not working code?

There is a formula: Under this formula, try using biblioteki numpy to calculate their values: I have got such code:N = np.arange(proc+1) np.sum(np.power(R, N) / (math.factorial(N))) in the end, I get the following error:TypeError: only size-1 arrays can be converted to Python scalars Anyone know how to solve etwa briskly?
Melvin.Runolfsdott asked April 2nd 20 at 15:22
0
answer

In numpy c using mt19937 to a binary sequence?

Need to binary sequence using Vortex Mersenne. The idea was to use the built-in pitoni random in the following way:import random as rd p=[] k=int(1.1*10**8) for i in range(k): p.append(rd.getrandbits(1)) #print(p) s=" for i in p: s+=str(i) a=p.count(0) b=p.count(1) f = open('sec.txt', 'w') f.write(s) f.close() print(a,b) b...
adell.Ullri asked March 31st 20 at 21:52
1
answer

As in numpy many patterns to stitch into a single array?

def viborka(n): return t.rvs(df, size = n) a = np.array([viborka(5) for i in range(1000)]) [[ 0.87107139 0.73471817 1.12813296 -1.2529901 -0.56168773] [ 0.40370233 0.20711448 1.14176855 -1.27929904 -3.86284412] [-0.70015447 -0.68235379 -0.23642686 0.71142451 -0.74478162] ... [ 1.20858522 1.99604528 0.90842576 -1.49043...
ike_Sipes asked March 31st 20 at 21:27