I am currently working on a project where I'm analyzing hate crimes trends in Austin, TX. Presently, I have a problem with my data. With the 'incident_number' column, I want to split it into two...the numbers before the '-' clearly indicate the year, which I'd like to merge into the 'month' column. The numbers after the '-' I want to keep within the 'incident_number' column.
Anyone know how I can achieve this?
Originally I tried:
aus_final['incident_number'] = pd.to_datetime(aus_final['incident_number'], format='%d%m%Y')
which produced an error:
ValueError: time data '2017-241137' does not match format '%d%m%Y' (match)
I kinda knew that was going to happen but I had to try anyway. :P Needless to say, I'm very much a novice still with Python. Any help is greatly appreciated.