returns is a dataframe of 30 stock returns.
returns
I built the below function that computes hierarchical risk parity weights.
def hrp_weights(ret