vDataFrame[].str_contains

In [ ]:
vDataFrame[].str_contains(pat: str)

Verifies if the regular expression is in each of the vcolumn records. The vcolumn will be transformed.

Parameters

Name Type Optional Description
pat
str
❌
regular expression.

Returns

vDataFrame : self.parent

Example

In [78]:
from verticapy.datasets import load_titanic
titanic = load_titanic()
display(titanic["name"])
Abc
Varchar(164)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Rows: 1-100 of 1234 | Column: name | Type: varchar(164)
In [79]:
titanic["name"].str_contains(pat = " ([A-Za-z])+\.")
010
name
Boolean
1
✅
2
✅
3
✅
4
✅
5
✅
6
✅
7
✅
8
✅
9
✅
10
✅
11
✅
12
✅
13
✅
14
✅
15
✅
16
✅
17
✅
18
✅
19
✅
20
✅
21
✅
22
✅
23
✅
24
✅
25
✅
26
✅
27
✅
28
✅
29
✅
30
✅
31
✅
32
✅
33
✅
34
✅
35
✅
36
✅
37
✅
38
✅
39
✅
40
✅
41
✅
42
✅
43
✅
44
✅
45
✅
46
✅
47
✅
48
✅
49
✅
50
✅
51
✅
52
✅
53
✅
54
✅
55
✅
56
✅
57
✅
58
✅
59
✅
60
✅
61
✅
62
✅
63
✅
64
✅
65
✅
66
✅
67
✅
68
✅
69
✅
70
✅
71
✅
72
✅
73
✅
74
✅
75
✅
76
✅
77
✅
78
✅
79
✅
80
✅
81
✅
82
✅
83
✅
84
✅
85
✅
86
✅
87
✅
88
✅
89
✅
90
✅
91
✅
92
✅
93
✅
94
✅
95
✅
96
✅
97
✅
98
✅
99
✅
100
✅
Out[79]:
Rows: 1-100 of 1234 | Column: name | Type: boolean

See Also

vDataFrame[].str_count Computes the regular expression count match in each record of the vcolumn.
vDataFrame[].str_extract Extracts the regular expression in each record of the vcolumn.
vDataFrame[].str_replace Replaces the regular expression matches in each of the vcolumn record by an input value.
vDataFrame[].str_slice Slices the vcolumn.