I have a large list of rules in Mathematica, but I want to select an item that matches certain criteria. Although I tried to use the Select and Take commands, I was not able to get the desired result.
Example. Suppose I want to select an item from a list, where A-> 1.2.
list={{A->1,B->2.1,C->5.2},{A->1.1,B->2.6,C->5.5},{A->1.2,B->2.7,C->5.7},{A->1.3,B->2.9,C->6.1}};
The desired result will be {A-> 1.2, B-> 2.7, C> 5.7}
I know that you can select items from lists based on their value. But how to do it from the list of rules?
thank
EDIT: Apparently, cases do the trick:
Cases [list, {A-> # | A-> Rationalization [#], Rule [_, _] ..}] and /@{1.2}
It is also looking for numbers in a rational and irrational form, which was another problem.