Skip to main content
Minor clean-up
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

How to iteratingiterate through a list of rules?

Let's consider I have a list of rules:

{Aa ->1> 1/2, Av ->2> 2/5, Bx ->3> 3/7, Ce ->4> 4/9, ...}

I want to find all keys that contain "a"the letter "A" and change their values to expressions. This means to have as a result:

***Some code here...***
{Aa ->ToExpression[1> ToExpression[1/2], Av ->ToExpression[2> ToExpression[2/5], Bx->3/7, Ce->4/9, ...}

Thanks for any help!

How to iterating through a list of rules?

Let's consider I have a list of rules:

{Aa->1/2, Av->2/5, Bx->3/7, Ce->4/9, ...}

I want to find all keys that contain "a" letter and change their values to expressions. This means to have as a result:

***Some code here...***
{Aa->ToExpression[1/2], Av->ToExpression[2/5], Bx->3/7, Ce->4/9, ...}

Thanks for any help!

How to iterate through a list of rules?

Let's consider I have a list of rules:

{Aa -> 1/2, Av -> 2/5, Bx -> 3/7, Ce -> 4/9, ...}

I want to find all keys that contain the letter "A" and change their values to expressions. This means to have as a result:

***Some code here...***
{Aa -> ToExpression[1/2], Av -> ToExpression[2/5], Bx->3/7, Ce->4/9, ...}
Source Link
SuTron
  • 1.8k
  • 1
  • 11
  • 21

How to iterating through a list of rules?

Let's consider I have a list of rules:

{Aa->1/2, Av->2/5, Bx->3/7, Ce->4/9, ...}

I want to find all keys that contain "a" letter and change their values to expressions. This means to have as a result:

***Some code here...***
{Aa->ToExpression[1/2], Av->ToExpression[2/5], Bx->3/7, Ce->4/9, ...}

Thanks for any help!