They should be one regular expression, and should be in one string:

"nt|nv"  # rather than "nt" | " nv"
f_recs[f_recs['Behavior'].str.contains("nt|nv", na=False)]

Python doesn't let you use the or (|) operator on strings:

In [1]: "nt" | "nv"
TypeError: unsupported operand type(s) for |: 'str' and 'str'
Answer from Andy Hayden on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › pandas › python-pandas-series-str-contains
Pandas Series.str.contains() - Python - GeeksforGeeks
January 13, 2026 - The Series.str.contains() method is used to check whether each string value in a Pandas Series contains a given substring or pattern.
🌐
Statology
statology.org › home › pandas: how to check if column contains string
Pandas: How to Check if Column Contains String
March 31, 2025 - This tutorial explains how to check if a column contains a string in a pandas DataFrame, including several examples.
🌐
Medium
medium.com › @whyamit101 › understanding-pandas-series-str-contains-7c9a3b3bd545
Understanding pandas.Series.str.contains() | by why amit | Medium
February 26, 2025 - str.contains() is like asking Pandas, “Hey, does this text contain what I’m looking for?” It helps you filter data in a column based on whether a string pattern exists.
🌐
Vultr Docs
docs.vultr.com › python › third-party › pandas › Series › str › contains
Python Pandas Series str contains() - Check Substring Presence | Vultr Docs
December 5, 2024 - The str.contains() method in Pandas is an essential tool for checking the presence of a substring within each string element of a Series. This approach is particularly useful in data analysis and processing where conditions based on string patterns ...
🌐
w3resource
w3resource.com › pandas › series › series-str-contains.php
Pandas Series: str.contains() function - w3resource
September 15, 2022 - Pandas Series - str.contains() function: The str.contains() function is used to test if pattern or regex is contained within a string of a Series or Index.
Find elsewhere
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas series.str.contains() with examples
Pandas Series.str.contains() With Examples
December 9, 2024 - Pandas Series.str.contains() method is used to check whether each string in a Series contains a specified substring or pattern. It returns a
🌐
W3Schools
w3schools.com › python › ref_string_endswith.asp
Python String endswith() Method
The endswith() method returns True if the string ends with the specified value, otherwise False.
🌐
Python documentation
docs.python.org › 3 › tutorial › datastructures.html
5. Data Structures — Python 3.14.5 documentation
Dictionaries are sometimes found in other languages as “associative memories” or “associative arrays”. Unlike sequences, which are indexed by a range of numbers, dictionaries are indexed by keys, which can be any immutable type; strings and numbers can always be keys. Tuples can be used as keys if they contain only strings, numbers, or tuples; if a tuple contains any mutable object either directly or indirectly, it cannot be used as a key.
🌐
Python
docs.python.org › 3 › library › index.html
The Python Standard Library — Python 3.14.5 documentation
struct — Interpret bytes as packed binary data · codecs — Codec registry and base classes · Data Types · datetime — Basic date and time types · zoneinfo — IANA time zone support · calendar — General calendar-related functions · collections — Container datatypes ·
🌐
Note.nkmk.me
note.nkmk.me › home › python › pandas
pandas: Extract rows that contain specific strings from a DataFrame | note.nkmk.me
July 30, 2023 - By using str.contains(), you can generate a Series where elements that contain a given substring are True. pandas.Series.str.contains — pandas 2.0.3 documentation
🌐
Statology
statology.org › home › pandas: check if string contains multiple substrings
Pandas: Check if String Contains Multiple Substrings
October 10, 2022 - df['string_column'].str.contains(r'^(?=.*string1)(?=.*string2)') The following examples show how to use each method in practice with the following pandas DataFrame:
🌐
pandas
pandas.pydata.org › Pandas_Cheat_Sheet.pdf pdf
with pandas Cheat Sheet http://pandas.pydata.org
Logic in Python (and pandas) < Less than · != Not equal to · > Greater than · df.column.isin(values) Group membership · == Equals · pd.isnull(obj) Is NaN · <= Less than or equals · pd.notnull(obj) Is not NaN · >= Greater than or equals · &,|,~,^,df.any(),df.all() Logical and, or, not, xor, any, all · regex (Regular Expressions) Examples · '\.' Matches strings containing a period '.' 'Length$' Matches strings ending with word 'Length' '^Sepal' Matches strings beginning with the word 'Sepal' '^x[1-5]$' Matches strings beginning with 'x' and ending with 1,2,3,4,5 ·
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.Series.str.match.html
pandas.Series.str.match — pandas 3.0.3 documentation
For the nullable StringDtype, pandas.NA is used. Returns: Series/Index/array of boolean values · A Series, Index, or array of boolean values indicating whether the start of each string matches the pattern. The result will be of the same type as the input. See also · fullmatch · Stricter matching that requires the entire string to match. contains ·
🌐
Medium
deallen7.medium.com › using-pandas-contains-method-to-filter-a-dataframe-column-for-specific-words-or-phrases-7567e7dcebb8
Using Pandas’ contains() method to filter a DataFrame column for specific words or phrases | by David Allen | Medium
July 26, 2022 - Using Pandas’ contains() method to filter a DataFrame column for specific words or phrases Documentation for using Panda’s contains() method to filter a Pandas DataFrame on a specific string …
🌐
PYnative
pynative.com › home › python exercises
Python Exercises, Practice, Challenges [570+ Exercises] – PYnative
Topics: Python Basics, Variables, Operators, Loops, String, Numbers, List ... This exercise contains coding challenges to solve using if-else conditions, for loops, the range() function, and while loops.
🌐
PyPI
pypi.org › project › python-dotenv
python-dotenv · PyPI
Add encoding (Optional[str]) parameter to get_key, set_key and unset_key.
      » pip install python-dotenv
    
Published   Mar 01, 2026
Version   1.2.2