in of a Series checks whether the value is in the index:

In [11]: s = pd.Series(list('abc'))

In [12]: s
Out[12]: 
0    a
1    b
2    c
dtype: object

In [13]: 1 in s
Out[13]: True

In [14]: 'a' in s
Out[14]: False

One option is to see if it's in unique values:

In [21]: s.unique()
Out[21]: array(['a', 'b', 'c'], dtype=object)

In [22]: 'a' in s.unique()
Out[22]: True

or a python set:

In [23]: set(s)
Out[23]: {'a', 'b', 'c'}

In [24]: 'a' in set(s)
Out[24]: True

As pointed out by @DSM, it may be more efficient (especially if you're just doing this for one value) to just use in directly on the values:

In [31]: s.values
Out[31]: array(['a', 'b', 'c'], dtype=object)

In [32]: 'a' in s.values
Out[32]: True
Answer from Andy Hayden on Stack Overflow
🌐
Spark By {Examples}
sparkbyexamples.com › home › pandas › pandas check column contains a value in dataframe
Pandas Check Column Contains a Value in DataFrame - Spark By {Examples}
December 11, 2024 - You can perform a case-insensitive check using the str.contains() method in pandas. You can achieve this by setting the case parameter to False. How can I negate the condition and filter rows where the column does not contain a specific value?
Discussions

How do i check if a dataframe column contains lists?
I'm not sure if pandas offers much help here apart from checking every value yourself: >>> df = pd.DataFrame({"A": [1, 2, 1], "B": [[4], "5", [4]]}) >>> df.map(lambda x: isinstance(x, list)) A B 0 False True 1 False False 2 False True Using tuples is the usual approach if the list type is not important to you: >>> df.map(lambda x: tuple(x) if isinstance(x, list) else x).drop_duplicates() A B 0 1 (4,) 1 2 5 (If the lists are nested, you'll need to change them at each level.) More on reddit.com
🌐 r/learnpython
6
1
June 18, 2024
How to Check if Any Value in a List Is in either of Two Columns With Pandas
df[df[['work_email', 'personal_email']].isin(FilterThese).any(axis=1)] More on reddit.com
🌐 r/learnpython
3
6
December 12, 2022
Pandas question - check if the content of a cell is contained in another cell
If your dataframe is made from real lists, your columns will be lists df = pd.DataFrame({'L1': [['Cat', 'Bird', 'Fox'], ['Fish', 'Bird'], ['Cat', 'Dog'], ['Fish', 'Fox'], ['Dog', 'Fox', 'Fish']], 'L2': [['Cat', 'Fox'], ['Fox', 'Fish'], ['Cat', 'Dog'], ['Bird'], ['Fox', 'Dog', 'Fish']]}) >>> L1 L2 0 [Cat, Bird, Fox] [Cat, Fox] 1 [Fish, Bird] [Fox, Fish] 2 [Cat, Dog] [Cat, Dog] 3 [Fish, Fox] [Bird] 4 [Dog, Fox, Fish] [Fox, Dog, Fish] Then, you can apply function like this df['Partial_1'] = df.apply(lambda x : set(x['L1']).intersection(set(x['L2'])), axis=1) df['Partial_2'] = df.apply(lambda x : bool(set(x['L1']).intersection(set(x['L2']))), axis=1) >>> L1 L2 Partial_1 Partial_2 0 [Cat, Bird, Fox] [Cat, Fox] {Cat, Fox} True 1 [Fish, Bird] [Fox, Fish] {Fish} True 2 [Cat, Dog] [Cat, Dog] {Cat, Dog} True 3 [Fish, Fox] [Bird] {} False 4 [Dog, Fox, Fish] [Fox, Dog, Fish] {Fish, Dog, Fox} True If your columns are made from list-like strings, then you must make them into lists. df = pd.DataFrame({'L1': ["['Cat', 'Bird', 'Fox']", "['Fish', 'Bird']", "['Cat', 'Dog']", "['Fish', 'Fox']", "['Dog', 'Fox', 'Fish']"], 'L2': ["['Cat', 'Fox']", "['Fox', 'Fish']", "['Cat', 'Dog']", "['Bird']", "['Fox', 'Dog', 'Fish']"]}) df["L1"] = df["L1"].str.replace("[\]\[ ']", '', regex=True).str.split(',') df["L2"] = df["L2"].str.replace("[\]\[ ']", '', regex=True).str.split(',') More on reddit.com
🌐 r/learnpython
5
1
October 12, 2023
How to check if -any- item from a list of strings is in a Pandas series?
take a look at the function any() More on reddit.com
🌐 r/learnpython
3
1
May 22, 2022
🌐
Statology
statology.org › home › pandas: how to check if value exists in column
Pandas: How to Check if Value Exists in Column
August 22, 2022 - #check if 'J' exists in the 'team' column 'J' in df['team'].values False · The output returns False, which tells us that the string ‘J’ does not exist in the team column. The following code shows how to check if any of the values in the list [44, 45, 22] exist in the points column:
🌐
Saturn Cloud
saturncloud.io › blog › how-to-check-if-one-value-exists-in-any-rows-of-any-columns-in-pandas
How to Check if One Value Exists in Any Rows of Any Columns in Pandas | Saturn Cloud Blog
December 19, 2023 - The any() method is applied twice, once for columns and once for rows, to check if any element in the DataFrame is equal to 4. If the value 4 exists in any rows of any columns, we print “Value 4 exists in the DataFrame”, otherwise, we print ...
🌐
Saturn Cloud
saturncloud.io › blog › how-to-check-if-pandas-column-has-value-from-list-of-strings
How to Check if Pandas Column Has Value from List of Strings | Saturn Cloud Blog
November 3, 2023 - We also have a list of fruits we ... efficient way to check if a Pandas column has a value from a list of strings is to use the .isin() method....
🌐
GeeksforGeeks
geeksforgeeks.org › check-if-a-value-exists-in-a-dataframe-using-in-not-in-operator-in-python-pandas
Check if a value exists in a DataFrame using in & not in operator in Python-Pandas - GeeksforGeeks
December 6, 2022 - A "list of strings" refers to a list where each element is a string, and our goal is to determine whether the values in a specific column of the DataFrame are present in that list. Let's learn how to check if a Pandas DataFrame column contains any value from a list of strings in Python.Checking Pand
🌐
GeeksforGeeks
geeksforgeeks.org › pandas › how-to-check-if-pandas-column-has-value-from-list-of-string
How to Check if a Pandas Column Has a Value from a List of Strings? - GeeksforGeeks
June 12, 2025 - For example, if we have a list like ['java', 'c'] and want to find all rows in the subjects column containing these values, the output will only include the rows where the subject is 'java' or 'c'. The isin() function checks whether each value ...
Find elsewhere
🌐
W3Schools
w3schools.com › python › pandas › ref_df_any.asp
Pandas DataFrame any() Method
import pandas as pd data = [[True, False, True], [True, False, False]] df = pd.DataFrame(data) print(df.any()) Try it Yourself » · The any() method returns one value for each column, True if ANY value in that column is True, otherwise False.
🌐
Reddit
reddit.com › r/learnpython › how to check if any value in a list is in either of two columns with pandas
r/learnpython on Reddit: How to Check if Any Value in a List Is in either of Two Columns With Pandas
December 12, 2022 -

I am loading a csv as a pandas dataframe.

The headers of the csv are: fname,lname,linkedin_url,work_email,personal_email,cell_phone,company_name,job_title,company_website,industry,location,gender,birth_day

I have a list of emails that I want to filter the dataframe with and keep the records that are in the list. I figured out how to do it based on one column using this:

datafilters = df['work_email'].isin(FilterThese)

How do I adjust the above so it checks if the values in the list "FilterThese" exist in either 'work_email' or 'personal_email'?

Thank you!

🌐
Statology
statology.org › home › pandas: how to check if column contains string
Pandas: How to Check if Column Contains String
March 31, 2025 - # First find which rows contain your partial string mask = df[‘conference’].str.contains(‘Eas’) # Get those rows from the DataFrame matching_rows = df[mask] # Extract the values from the column matching_values = matching_rows[‘conference’].tolist() print(matching_values) # Should output [‘East’, ‘East’, ‘East’] # If you want unique values only unique_matches = list(set(matching_values)) print(unique_matches) # Should output [‘East’] I hope this helps! Let me know if you have any other questions.
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.isin.html
pandas.DataFrame.isin — pandas 3.0.1 documentation
If values is a DataFrame, then both the index and column labels must match. ... DataFrame of booleans showing whether each element in the DataFrame is contained in values. ... Equality test for DataFrame. ... Equivalent method on Series. ... Test if pattern or regex is contained within a string of a Series or Index. ... __iter__ is used (and not __contains__) to iterate over values when checking if it contains the elements in DataFrame.
🌐
Quora
quora.com › If-I-want-to-check-if-a-value-exists-in-a-Panda-dataframe-what-Python-code-can-I-write
If I want to check if a value exists in a Panda dataframe, what Python code can I write? - Quora
Answer (1 of 7): The ways :- 1.If you want to search single value in whole dataframe [code]yourValue = randomNumber for cols in df.columns: if (yourValue in df[cols]: print('Found in '+cols) #to print the column name if found [/code]for text value instead of number you can use astype(str) af...
🌐
Statology
statology.org › home › pandas: select rows where value appears in any column
Pandas: Select Rows Where Value Appears in Any Column
September 1, 2020 - The following syntax shows how to select all rows of the DataFrame that contain the values G or C in any of the columns: df[df.isin(['G', 'C']).any(axis=1)] points assists position 0 25 5 G 1 12 7 G 4 19 12 C · How to Filter a Pandas DataFrame on Multiple Conditions How to Find Unique Values in Multiple Columns in Pandas How to Get Row Numbers in a Pandas DataFrame
🌐
TutorialsPoint
tutorialspoint.com › article › how-to-check-if-pandas-column-has-value-from-list-of-string
How to check if Pandas column has value from list of string?
August 9, 2023 - We can pass any python object such as list, tuple or array objects etc., and check if the contents of the given object exists in the current data set. ... In this example, we will use the isin() function of the NumPy library to check if pandas ...
🌐
w3resource
w3resource.com › python-exercises › pandas › index › pandas-indexing-exercise-11.php
Pandas: Check if a value exists in single/multiple columns index dataframe - w3resource
September 6, 2025 - import pandas as pd df = pd.DataFrame({ 'school_code': ['s001','s002','s003','s001','s002','s004'], 'class': ['V', 'V', 'VI', 'VI', 'V', 'VI'], 'name': ['Alberto Franco','Gino Mcneill','Ryan Parkes', 'Eesha Hinton', 'Gino Mcneill', 'David Parkes'], 'date_of_birth': ['15/05/2002','17/05/2002','16/02/1999','25/09/1998','11/05/2002','15/09/1997'], 'weight': [35, 32, 33, 30, 31, 32]}, index = ['t1', 't2', 't3', 't4', 't5', 't6']) print("Original DataFrame with single index:") print(df) print("\nCheck a value is exist in single column index dataframe:") print('t1' in df.index) print('t11' in df.ind
🌐
IncludeHelp
includehelp.com › python › how-to-determine-whether-a-pandas-column-contains-a-particular-value.aspx
How to determine whether a Pandas Column contains a particular value?
December 2, 2025 - # Import pandas Package import pandas as pd # Creating dictionary d = { 'Name':['Ankit', 'Tushar', 'Saloni','Jyoti', 'Anuj', 'Rajat'], 'Age':[23, 21, 22, 21, 24, 25], 'University':['BHU', 'JNU', 'DU', 'BHU', 'Geu', 'Geu'] } # Creating a Dataframe df = pd.DataFrame(d,index = ['a', 'b', 'c', 'd', 'e', 'f']) print("Created Dataframe:\n", df) # check 'Jyoti' exist in DataFrame or not if 'Jyoti' in df.values : print("\nYes,'Jyoti' is Present in DataFrame") else : print("\nSorry!, This value does not exists in Dataframe") ... How to select rows with one or more nulls from a Pandas DataFrame without listing columns explicitly? How to convert column value to string in pandas DataFrame? ... Comments and Discussions!
🌐
TutorialsPoint
tutorialspoint.com › article › checking-if-a-value-exists-in-a-dataframe-using-in-and-not-in-operators-in-python-pandas
Checking if a Value Exists in a DataFrame using \'in\' and \'not in\' Operators in Python Pandas
September 1, 2023 - In this example, we create a DataFrame with two columns: "Name" and "Age". We aim to check if the value "Michael" does not exist in the 'Name' column. By utilizing the "not in" operator, we compare the value against the values in the "Name" column using the ".values" attribute. Consider the code shown below. import pandas as pd # Create a DataFrame df = pd.DataFrame({'Name': ['John', 'Alice', 'Bob', 'Emily'],'Age': [25, 30, 28, 35]}) # Check if a value does not exist in the 'Name' column value = 'Michael' if value not in df['Name'].values: print(f"{value} does not exist in the DataFrame.") else: print(f"{value} exists in the DataFrame.")