Skip to content

Numpy Array Conditional Operation Mask?

Suppose you have an array: a = [ 0,1,0] [-1,2,1] [3,-4,2] And lets say you add 20 to everything b = [ 20, 21, 20] [ 19, 22, 21] [ 23, 16, 22] Now lets say I want to add the resulting b to the original array a but only in cases where a < 0 i.e at the index

Understanding scipy deconvolve

I’m trying to understand scipy.signal.deconvolve. From the mathematical point of view a convolution is just the multiplication in fourier space so I would expect that for two functions f and g: Deconvolve(Convolve(f,g) , g) == f In numpy/scipy this is either not the case or I’m missing an importan…

How to make a board in python?

I am trying to create a board that lets users choose the number of rows and columns but I can’t seem to put anything together! For example if a user wants 3 rows and 3 columns I am trying to make it print out: My code so far: and this is what it outputs: I feel really dumb for not