We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62b6d25 commit f85acd9Copy full SHA for f85acd9
pandas/tests/computation/test_eval.py
@@ -692,6 +692,18 @@ def test_disallow_python_keywords(self):
692
with pytest.raises(SyntaxError, match=msg):
693
df.query("lambda == 0")
694
695
+ def test_true_false_logic(self):
696
+ # GH 25823
697
+ assert pd.eval("not True") == -2
698
+ assert pd.eval("not False") == -1
699
+ assert pd.eval("True and not True") == 0
700
+
701
+ def test_and_logic_string_match(self):
702
703
+ event = Series({"a": "hello"})
704
+ assert pd.eval(f"{event.str.match('hello').a}")
705
+ assert pd.eval(f"{event.str.match('hello').a and event.str.match('hello').a}")
706
707
708
f = lambda *args, **kwargs: np.random.randn()
709
0 commit comments