Sam
Sam

Reputation: 29

Filtering out contents of cells in DataFrames

enter image description here

The picture above is an example of my DataFrame. It is a large DataFrame and I have a condition I need to check. The 'CC Exp Date' columns has all of its data in the format of:

Data1/Data2

That is month by year. I want to get all the instances where Data 2 == 25. How do I do this? Help is appreciated

Upvotes: 0

Views: 31

Answers (1)

Kurt Kline
Kurt Kline

Reputation: 2069

df.loc[df["CC Exp Date"].str.contains("/25")]

Upvotes: 1

Related Questions