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
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)
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
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)