I want to set the values of the digonal in a pandas.df. I followed the answer in Set values on the diagonal of pandas.DataFrame
The solution of df.values[[np.arange(df.shape[0])] * 2] = 0
works fine.
But I wish to use np.fill_diagonal(df.values, 0)
which gives AttributeError: 'DataFrame' object has no attribute 'flat'