I have a dataframe, df:
data = [{0: 18, 1: '(Responses) 17th Nov 20'},
{0: 304, 1: '(Responses) 17th Nov 20'},
{0: 1177, 1: '(Responses) 17th Nov 20'},
{0: 899, 1: '(Responses) 17th Nov 20'}]
df = pd.DataFrame(data)
0 1
18 (Responses) 17th Nov 20
304 (Responses) 17th Nov 20
1177 (Responses) 17th Nov 20
899 (Responses) 17th Nov 20
Is there any efficient way to extract out 17th Nov 2020 and make it to a new column[2] as 17-11-2020 as date?
It can also be 1st or 2nd or 3rd for other date.
Expected output:
0 1 2
18 (Responses) 17th Nov 20 17-11-2020
304 (Responses) 17th Nov 20 17-11-2020
1177 (Responses) 17th Nov 20 17-11-2020
899 (Responses) 17th Nov 20 17-11-2020
df[1].str.split(n=1, expand=True)?n=1it only splits once.