Let's say I've got in several DataFrames one particular Serie like this :
serie_complete_days = pd.Series(['20190320','20190321','20190322', '20190323', '20190324', '20190325', '20190326', '20190327'])
I'm trying to retain only two parts of each string (the day and the month) and replace them in a european format, like this.
the_goal_is = pd.Series(['20-03','21-03','22-03', '23-03', '24-03', '25-03', '26-03', '27-03'])
I started to isolate each part with str.slice() function :
days_only = serie_complete_days.str.slice(start = 6, stop = 8)
months_only = serie_complete_days.str.slice(start = 4, stop = 6)
I thougth it was the easiest way, because I didn't change the index of my DF. But I missed something after, and I don't know which function is the best for that between str.join(), str.replace() or str.update()...
Thanks in advance !
EDIT : I want to keep this string as a string. No to_datetime(), please