The linkage
function does not need the metric
argument, unlees you pass in your original observations instead of a distance matrix.
From your posted link
y : ndarray
[...] Alternatively, a collection of m observation vectors in n dimensions may be passed as an m by n array.
The linkage
function checks, if you passed in a valid distance matrix - presumable using is_valid_y
/ is_valid_dm
- and if not it will first apply pdist
with the metric you have specified (and euclidean metric if nothing has been specified).