I'm trying to use regex to extract two element fields.
From this list: df=pd.DataFrame({'Score':'Touch\n4.90\nDraw\n4.30\nDown\n1.58\nOver\n2.5\n1.65\nUnder\n2.5\n2.23']})
Desired result: 1.65\n2.23
As showing I've partially attempted to remove some unwanted bits but getting lost with the other. What do I need to add to my regex solution to achieve my desired result.
import pandas as pd
df=pd.DataFrame({'Score': ['Touch\n4.90\nDraw\n4.30\nDown\n1.58\nOver\n2.5\n1.65\nUnder\n2.5\n2.23']})
df = df['Score'].str.replace(r'([^\d\.\n])', '').str.strip()
df
0 4.90\n\n4.30\n\n1.58\n\n2.5\n1.65\n\n2.5\n2.23
Name: Score, dtype: object