distance matrix of curves in python distance matrix of curves in python numpy numpy