// Form a 1D array of values to be used in the matrix, containing a reversed// copy of r[1:], followed by c.
vals = np.concatenate((r[-1:0:-1], c))
a, b = np.ogrid[0:len(c), len(r) - 1:-1:-1]
indx = a + b// `indx` is a 2D array of indices into the 1D array `vals`, arranged so// that `vals[indx]` is the Toeplitz matrix.return vals[indx]def circulant(c):