Aryan PrajapatKnowledge Contributor
How to get items of series A that are not available in another series B?
How to get items of series A that are not available in another series B?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
import pandas as pd
# Creating 2 pandas Series
ps1 = pd.Series([2, 4, 8, 20, 10, 47, 99])
ps2 = pd.Series([1, 3, 6, 4, 10, 99, 50])
print(“Series 1:”)
print(ps1)
print(“nSeries 2:”)
print(ps2)
# Using Bitwise NOT operator along
# with pandas.isin()
print(“nItems of Series 1 not present in Series 2:”)
res = ps1[~ps1.isin(ps2)]
print(res)