Is there an equivalent in Python to match.arg() as you have in R? Basically limiting the user the choice of inputs one can make for an input function parameter.
I know it is an old question, but I needed this and there is no answer. So, just for future need:
def match_arg(x, lst):
return [el for el in lst if x in el]
lst = ["gaussian", "epanechnikov", "rectangular", "triangular"]
print(match_arg("gauss", lst))
print(match_arg("pauss", lst))
Which yield:
['gaussian']
[]
Kr.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With