Timeline for Accumulated instance count of each list element
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 1, 2023 at 16:04 | history | edited | Syed | CC BY-SA 4.0 |
added a variant
|
Dec 1, 2023 at 14:20 | vote | accept | thecommexokid | ||
Dec 1, 2023 at 14:20 | comment | added | thecommexokid |
The Count[list〚1 ;; #〛, list〚#〛] & option is what I ultimately went with as it was, IMO, the clearest, from among all the options everyone presented, to see at a glance what it was doing.
|
|
Nov 30, 2023 at 4:02 | comment | added | Syed | Depends on the time of the day or the phase of the moon. | |
Nov 30, 2023 at 4:01 | comment | added | thecommexokid | Of these, do you have a favorite? | |
Nov 30, 2023 at 3:53 | comment | added | thecommexokid |
MapIndexed[Count[list[[1 ;; First@#2]], #1] &, list] is the one I was halfway to formulating in my head. Not surprised that there are many possible approaches…but I am surprised that none of them is very legible! Assuming that nobody comes along with an even cleverer idea than any of these, that is.
|
|
Nov 30, 2023 at 3:42 | history | answered | Syed | CC BY-SA 4.0 |