We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3fe86e9 commit 78683c1Copy full SHA for 78683c1
1 file changed
Utils.py
@@ -31,3 +31,21 @@ def to_number(dataval):
31
32
except ValueError:
33
return dataval
34
+
35
36
+def contains(string_or_iterable):
37
+ if isinstance(string_or_iterable, str):
38
+ return lambda x: string_or_iterable in x
39
+ else:
40
+ return lambda x: any(i in x for i in string_or_iterable)
41
42
+def startswith(string_or_iterable):
43
+ if not isinstance(string_or_iterable, str):
44
+ string_or_iterable = tuple(string_or_iterable)
45
+ return lambda x: x.startswith(string_or_iterable)
46
47
+def sel_contains(string_or_iterable):
48
+ return dict(crit=contains(string_or_iterable), axis=1)
49
50
+def sel_startswith(string_or_iterable):
51
+ return dict(crit=startswith(string_or_iterable), axis=1)
0 commit comments