# Kmeans problem

**URL:** https://discourse.julialang.org/t/kmeans-problem/34210
**Category:** General Usage
**Created:** [February 5, 2020, 3:44pm UTC](https://discourse.julialang.org/t/kmeans-problem/34210 "2020-02-05T15:44:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![muhammetfaik](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@muhammetfaik](https://discourse.julialang.org/u/muhammetfaik)
#### Post date: [February 5, 2020, 3:44pm UTC](https://discourse.julialang.org/t/kmeans-problem/34210/1 "2020-02-05T15:44:36Z")

</div>

[https://github.com/muhammetfaik/julia-tutorial/issues/1](https://github.com/muhammetfaik/julia-tutorial/issues/1)

---

<div class="post-metadata">

### Author: ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)
#### Post date: [February 5, 2020, 5:18pm UTC](https://discourse.julialang.org/t/kmeans-problem/34210/2 "2020-02-05T17:18:38Z")

</div>

You forgot a `s` in `zeros` when initializing distances (see my answer in your issue).

Notes:

- you should generally post the code here (on discourse) if you want a bigger chance of people not ignoring your post
- use ````julia` in order to highlight code with julia on Github (here it’s done automatically)
- remove visualisation stuff etc which are not directly related to your problem
- you may want to consider the package `NearestNeighbours.jl`

PS: Tamas would have done it eventually so also please consider [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757)
