How to change year value in numpy datetime64?

Viewed 6404

I have a pandas DataFrame with dtype=numpy.datetime64 In the data I want to change

'2011-11-14T00:00:00.000000000'

to:

'2010-11-14T00:00:00.000000000'

or other year. Timedelta is not known, only year number to assign. this displays year in int

Dates_profit.iloc[50][stock].astype('datetime64[Y]').astype(int)+1970

but can't assign value. Anyone know how to assign year to numpy.datetime64?

3 Answers
Related