pat = r"(?P<one>\w+) (?P<two>\w+) (?P<three>\w+)"
repl = lambda m: m.group('two').swapcase()
ser = pd.Series(['One Two Three', 'Foo Bar Baz'])
ser.str.replace(pat, repl, regex=True)
0 tWO
1 bAR
dtype: object
if the argument m in lambda is not given any parameter, how it this code able to give an output?