Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort() issue on hclust.py file #1

Open
ShibaPrasad opened this issue Mar 8, 2017 · 0 comments
Open

sort() issue on hclust.py file #1

ShibaPrasad opened this issue Mar 8, 2017 · 0 comments

Comments

@ShibaPrasad
Copy link

ShibaPrasad commented Mar 8, 2017

i executed your files for my understanding and getting below error.
Envirement: Python 2.7.13 and wondows

line 153, in hierarchical_clustering
current_clusters.sort()
AttributeError: 'dict' object has no attribute 'sort'


My Solution: **


For the above issue i just changed the line
from - <current_clusters.sort()> to <sorted(current_clusters>
and the final out put is:

0.819168173599
0.862857142857
[100, 102, 103, 104, 105, 107, 108, 109, 110, 111, 112, 115, 116, 117, 118, 120, 122, 124, 125, 128, 129, 130, 131, 132, 134, 135, 136, 137, 139, 140, 141, 143, 144, 145, 147, 148]
[50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 106, 113, 114, 119, 121, 123, 126, 127, 133, 138, 142, 146, 149]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]


It looks like out is same as your out put. But I would like to conform with you (for the above change)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant