I download a CSV file from the internet which contains information about the file in the first row and headers begin on the second row. If I open this CSV file in Excel, cell I1 has Viewing=[12/15/19 - 12/21/19]
. I would like to extract the first date in this cell 2019-12-15
and create a new column with this date that runs all the way down.
df before (z-r contain information about the file a-j are actual column headers):
z,y,x,w,v,u,t,s,Viewing=[12/15/19 - 12/21/19],r
a,b,c,d,e,f,g,h,i,j
1,2,3,4,5,6,7,8,9,10
df expected after (information rowgone):
date,a,b,c,d,e,f,g,h,i,j
2019-12-15,1,2,3,4,5,6,7,8,9,10
How can I extract that specific value (2019-15-19
in this case)? I know that once I get it I can do df['date'] = date_extracted
. My guess is that this is easiest done with regex, but I have almost no knowledge of it.