Use data .- centroids[1, :]'
to transpose centroids[1,:]
to a 1 \times 2 row vector.
See also Unintuitive Julia result: selecting a row from a matrix
Use data .- centroids[1, :]'
to transpose centroids[1,:]
to a 1 \times 2 row vector.
See also Unintuitive Julia result: selecting a row from a matrix