Distribute_value

I know this would be really silly to ask but still I would like to ask that how to create a matrix where every entry is the “average” value because it outputs an error message “Output must be a np.ndarray” every time I try to create one

Which week?
Which assignment?

week 1
convolutional model step by step

Thank you. I resolved it

In case others end up here with a similar question ( not silly btw )

There are almost always multiple ways to accomplish a task in Python. One straightforward way to do this one would be to use numpy.average() to get the value, and numpy.full() using that computed value and the shape of the original.

https://numpy.org/doc/stable/reference/generated/numpy.average.html

numpy. full ( shape , fill_value , dtype=None , order=‘C’ , *** , like=None )[source]

Return a new array of given shape and type, filled with fill_value .

Hi,

I have a question about this function too.

I used (n_H, n_W) = np.shape(shape), but get an error ValueError: not enough values to unpack (expected 2, got 1)

Thank you for your time.