I have a data frame with two columns, one are dates and the other are values, the date formate is 1913-01-01T00:00:00.000Z but I want it to change to 1913-01 and remove everything else, the problem is id like to do it for the whole data frame. this is what I have so far
#fixing the format of the date in the DFs and shortning them.
import datetime as dt
inflation['Yearmon'] = pd.to_datetime(inflation['Yearmon'])
inflation.rename(columns = {'Yearmon':'Date'}, inplace = True)