I have a pandas dataframe where the date column contains values such as: 20190709 20190710 20190708
let's call this column: date
I want to convert this to appear as '2019-07-09'
trying some random things, but seem to be way off base. Can anyone help me get the right formula for this? I'm guessing it is pretty simple but I am spending more time guessing than necessary
Here is one thing I've tried recently, not sure what is happening
df['date2'] = datetime.strptime(df['date'].astype(str),"%Y-%m-%d")
getting an error message of "strptime() argument 1 must be str, not Series"