Create matrices of a certain format
One of the main features of NumPy is that you can work with matrices without explicit looping.  To get the diagonal, use np.identity().  To set everything else, use broadcasting.

def make_matrix(value, dim):
    return value - value * dim * np.identity(dim, dtype=np.double)


param and N don't mean anything to me.  I suggest value and dim.  The function name should preferably be make_matrix, according to PEP 8.