I have a date column in a pandas DF with Julian dates. How can I convert these Julian dates to mm-dd-yyyy format.
Sample data
ORG CHAIN_NBR SEQ_NBR INT_STATUS BLOCK_CODE_1 DATA_BLOCK_CODE_1
0 523 1 0 A C 2012183
1 523 2 1 I A 2013025
2 521 3 1 A H 2007067
3 513 4 1 D H 2001046
4 513 5 1 8 I 2006075
I was using jd2gcal
function but it's not working. I was also trying to write a code like this but of no use.
for i,row in amna.iterrows():
amna['DATE_BLOCK_CODE_1'] = datetime.datetime.strptime(row['DATE_BLOCK_CODE_1'], '%Y%j')
desired Output:
ORG CHAIN_NBR SEQ_NBR INT_STATUS BLOCK_CODE_1 DATA_BLOCK_CODE_1
0 523 1 0 A C mm-dd-yyyy
1 523 2 1 I A mm-dd-yyyy
2 521 3 1 A H mm-dd-yyyy
3 513 4 1 D H mm-dd-yyyy
4 513 5 1 8 I mm-dd-yyyy
Please help me with this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…