Timeline for How to change a value within a list of lists?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 7, 2014 at 6:21 | answer | added | PaulSunday | timeline score: 0 | |
Feb 15, 2013 at 19:43 | vote | accept | Joseph | ||
Feb 15, 2013 at 0:40 | answer | added | Murta | timeline score: 5 | |
Feb 14, 2013 at 18:46 | answer | added | Stefan | timeline score: 3 | |
Feb 14, 2013 at 18:10 | answer | added | Szabolcs | timeline score: 1 | |
Jan 24, 2013 at 21:31 | comment | added | Szabolcs |
Simon gave you the solution. Why your version doesn't work is twofold: 1. ? must be followed by a function. First@# == "star" & is a function but (Last@(First@# == "star" &)) is not 2. you are replacing the whole thing that _ ? ... matches not just the second part of that subexpression.
|
|
Jan 24, 2013 at 21:22 | comment | added | Sjoerd C. de Vries |
The First part of your pattern works alright, but you can't take the Last of that. It doesn't mean that the last part of your matching is replaced by 1000.
|
|
Jan 24, 2013 at 20:47 | comment | added | Simon Woods |
Why not just tally /. {"star", _} -> {"star", 1000} ?
|
|
Jan 24, 2013 at 20:40 | history | asked | Joseph | CC BY-SA 3.0 |