How to compute correlation of each row?

Can anyone suggest alternative ways to compute the correlation of each row in a pandas DataFrame using Python? I have tried using the ‘corr’ function, but I want to learn about more alternative methods.

This method computes the correlation between each pair of columns or rows in a DataFrame. By default, corr() computes the Pearson correlation coefficient, which measures the linear relationship between two variables.