File tree 1 file changed +10
-0
lines changed
docs/demos/column-selector-functions
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ Use column selector functions in the `columns=` argument to conveniently choose
14
14
#| echo: false
15
15
16
16
import pointblank as pb
17
+ import narwhals.selectors as ncs
17
18
18
19
validation = (
19
20
pb.Validate(
@@ -30,6 +31,10 @@ validation = (
30
31
.col_vals_not_null(
31
32
columns=pb.last_n(2) # check that the last two columns don't have Null values
32
33
)
34
+ .col_vals_regex(
35
+ columns=ncs.string(), # check that all string columns are non-empty strings
36
+ pattern=r"(.|\s)*\S(.|\s)*"
37
+ )
33
38
.interrogate()
34
39
)
35
40
@@ -38,6 +43,7 @@ validation
38
43
39
44
``` python
40
45
import pointblank as pb
46
+ import narwhals.selectors as ncs
41
47
42
48
validation = (
43
49
pb.Validate(
@@ -54,6 +60,10 @@ validation = (
54
60
.col_vals_not_null(
55
61
columns = pb.last_n(2 ) # check that the last two columns don't have Null values
56
62
)
63
+ .col_vals_regex(
64
+ columns = ncs.string(), # check that all string columns are non-empty strings
65
+ pattern = r " ( . | \s ) * \S ( . | \s ) * "
66
+ )
57
67
.interrogate()
58
68
)
59
69
You can’t perform that action at this time.
0 commit comments