task from eolymp with bad condition

Question:

I have a task to solve a rather interesting problem from the eolymp site, here is the link: https://www.eolymp.com/en/problems/7342, please solve the problem 100% in Python and drop the code in your answer.

I have gone through many options to solve this problem but it is too confusing for me

Asked By: NeizvesnNo

||

Answers:

You can filter then apply the drop. Try:

import pandas
import re

def ismatch(row):
    return bool(re.match(r"d+/d{2}", row["Column"]))

df = pandas.read_csv("Dataf.csv")
df = df[df.apply(ismatch, axis=1)].drop_duplicates().reset_index(drop=True)
print(df)
Answered By: JonSG
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.