Reputation: 5748
How can I do sokmething like that: (if possible)
options = {'topLimit': 22.3, 'downLimit': 9}
for row in tab.where('value < options['topLimit']'):
#whatever
...
...
Can we put something like options['topLimit']
or something similar inside the where
condition??
If not, how can it be done?
P.D: Note that this is a very simple example....I know the solution for this case is:
for row in tab.where('value < 22.3'):
I am thinking about much more complex situations.
Upvotes: 1
Views: 489
Reputation: 3637
Pass options in as the condvars argument to where:
options = {'topLimit': 22.3, 'downLimit': 9}
for row in tab.where('value < topLimit', options):
#whatever
See the documentation for more details [1].
Upvotes: 2