i am trying to remove all the character beside the last 4 from all the values in a numpy array. I'd normally use [-4:] but if i use that on the arra i only obtain the last 4 values in the array.
andatum = andatum[-4:] print(andatum)
'15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999']
runfile('O:/GIS/GEP/Risikomanagement/Flussvermessung/ALD/Analyses/ReadFilesToRawData.py', wdir='O:/GIS/GEP/Risikomanagement/Flussvermessung/ALD/Analyses') ['15.11.1999' '15.11.1999' '15.11.1999' '15.11.1999']
What i am trying to do is to obtain the same array but only with the last 4 digits (the year). Any idea how i could do that?
Thank you,
Davide
I would like to remove all the characters beside the last 4 (the year) but using [-4:] i get the last 4 entries of my numpy array.