Skip to content
Advertisement

Tag: gaussian

How to fill in missing center of a 2d gaussian

I have a 2d gaussian whose center has been destroyed by pixel saturation. I need the center to be filled in because a poorly filled in center will confuse a neural network I’m trying to train. See below: The scattered nan values I can handle fairly easily, but the large cluster in the gaussian’s center I cannot. I’ve tried various

Gaussian curve fitting in physics

I have this data, I tried to fit by a Gaussian function but I can’t found an appropriate function, I tried using curve_fit from scipy.optimize : I used this code : this is the result of this fit : Very bad fit The error message : Answer First, you’re not fitting a Gaussian function, you’re fitting the sum of a

Create a matrix with np.random.normal

I need to create an nxn matrix in which the numbers in the cells are distributed following a Gaussian distribution. This code may not go well because it fills a cell with a sequence. how can I do? Answer Edited for border of zeros np.random.normal takes a size keyword argument. You can use it like this:

Advertisement