I had a set of coordinates and plotted it as scatter graph. Then DBSCAN was applied to the points so the points that are closed together form a cluster (Note: the black dots are being classified as noise).
Now I wanted to find the centroid of the cluster (by adding the x & y coordinates together and average it out). I am able to obtain the set of coordinates (that is grouped into its respective cluster) and it looks like this:
[[10. 75.]
[11. 74.]
[11. 75.]
[12. 73.]
[12. 74.]
[12. 75.]]
[[34. 49.]
[34. 50.]
[35. 48.]
[35. 49.]
[35. 50.]
[36. 48.]
[36. 49.]
[36. 50.]]
[[43. 78.]
[43. 79.]
[43. 80.]
[43. 81.]
[44. 78.]
[44. 79.]
[44. 80.]
[44. 81.]
[45. 78.]
[45. 79.]
[45. 80.]
[45. 81.]
[46. 78.]
[46. 79.]
[46. 80.]
[46. 81.]
[47. 78.]
[47. 79.]
[47. 80.]
[47. 81.]
[48. 79.]
[48. 80.]]
[[53. 63.]
[53. 64.]
[53. 65.]
[54. 63.]
[54. 64.]
[54. 65.]
[54. 66.]
[55. 63.]
[55. 64.]
[55. 65.]
[55. 66.]
[56. 63.]
[56. 64.]
[56. 65.]
[56. 66.]]
[[ 72. 115.]
[ 73. 114.]
[ 73. 115.]
[ 73. 116.]
[ 73. 117.]
[ 73. 118.]
[ 74. 113.]
[ 74. 114.]
[ 74. 115.]
[ 74. 116.]
[ 75. 113.]
[ 75. 114.]
[ 75. 115.]
[ 75. 116.]
[ 75. 117.]
[ 76. 113.]
[ 76. 114.]
[ 76. 115.]
[ 76. 116.]
[ 76. 117.]
[ 77. 115.]
[ 77. 116.]]
[[79. 56.]
[79. 57.]
[79. 58.]
[79. 59.]
[80. 57.]
[80. 58.]
[80. 59.]]
...where each [[ & ]] marks the start and end of a cluster. So I am wondering if there is a way that I can save the set of cluster coordinates in a way that each group of cluster coordinates are saved seperately into its individual txt file (to make it easier to perform the averaging calculation later)?