Created
February 20, 2010 09:30
-
-
Save klochner/309607 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#try this data set: | |
ARR = [[1, "red"], [1, "green"], | |
[2, "red"], | |
[3, "yellow"], | |
[4, "red"], [4, "green"], [4, "yellow"], | |
[5, "green"], [5, "red"], | |
[6, "black"], | |
[7, "foo"], | |
[8, "bar"], | |
[9, "baz"], | |
[10, "baz"], | |
[11, "bar"]] | |
#I get the following: | |
[["green", "red", "yellow"], 1] | |
[["green", "red"], 3] | |
[["red"], 4] | |
[["yellow"], 2] | |
[["baz"], 2] | |
#yours gives this: | |
[["green", "red", "yellow"], 1] | |
[["green", "red"], 3] | |
[["red"], 4] | |
[["yellow"], 2] | |
[["foo"], 1] | |
[["black"], 1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment