If you provide a sample of your code, I can amend this answer to be more specific to your requirements. If this answer is deemed superfluous to the answer given in the quoted question, let me know, and I'll delete it.
I should make it clear, the following is a near exact replication of the answer to this question here: datetime to string with series in python pandas.
For some data frame:
df = pandas.Series(['20010101', '20010331'])
0 20010101
1 20010331
dtype: object
# Convert to the format you need:
dates = pandas.to_datetime(A, format = '%Y-%m-%d')
0 2001-01-01
1 2001-03-31
dtype: datetime64[ns]
# Then to convert back, do:
df2 = dates.apply(lambda x: x.strftime('%Y-%m-%d'))
0 2001-01-01
1 2001-03-31
dtype: object
Try using .loc[row_indexer,col_indexer] = value insteadData.loc['Date'] = Data['Date'].dt.strftime('%Y-%m-%d')it is not working and I receive the following error message: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame.applyand a lambda function out on your dataframe ala: stackoverflow.com/questions/19738169/…Data.loc[:, 'Date'] = Data['Date'].dt.strftime('%Y-%m-%d'). See more info in this post