Contains(text, case=Case.SENSITIVE)
Source¶
Bases: Rule
Keep the texts that contain a given text. Applies to text values only.
Added in version 0.1.0
Parameters:
-
text(str)The text to look for, anywhere in each value. It cannot be empty.
-
case(Case, default:Case.SENSITIVE)Whether upper and lower case are distinguished. Sensitive by default.
Raises:
-
InvalidTypeErrorWhen a setting is not of the type its annotation names.
-
EmptyTextErrorWhen
textis empty.
Examples:
import numdaplot as ndp
emails = ndp.Array.from_list(["ana@shop.fr", "bob@mail.com"])
emails.select(ndp.Contains(".fr"))
# Array(['ana@shop.fr'], dtype=TEXT)