Let's say I have a dataframe that looks like this:
df2 = pd.DataFrame(['Apple, 10/01/2016, 31/10/18, david/kate', 'orange', 'pear', 'Apple', '10/01/2016', '02/20/2017'], columns=['A'])
>>> df2
A file_name
0 Apple, 10/01/2016, 31/10/18, david/kate a.txt
1 orange a.txt
2 pear b.txt
3 Apple a.txt
4 10/01/2016 d.txt
5 02/20/2017 e.txt
What I would like is to just extract the dates in this dataframe, so output would be like this:
A file_name
0 10/01/2016, 31/10/18 a.txt
1 Nothing to return a.txt
2 Nothing to return b.txt
3 Nothing to return a.txt
4 10/01/2016 d.txt
5 02/20/2017 e.txt
Does anyone have any suggestions on how to do this? I am not sure where to begin.
Edit #1:
I edited my original dataframe and output results to better reflect what I am looking for.