我原来的数据是这样子的 :
日期 两年收益率 五年收益率 十年收益率
1 2023-01-30 2.435 2.723 2.913
2 2023-01-31 2.419 2.703 2.897
...........
然后我想序列号输出
XXX.to_json(orient="index", force_ascii=False)
变成下面这样子:
{"日期":1675641600000,"中国国债收益率 5 年":2.7054 ,......}
然后我想去掉时间戳:
XXX.to_json(orient="index", force_ascii=False,date_format='iso', date_unit='s')
变成了下面样子:
{"日期":"2023-02-06T00:00:00","中国国债收益率 5 年":2.7054}
但是我不需要秒级单位,我只需要到天 2023-02-06 ,要怎么才能去掉秒?求助各位大佬
日期 两年收益率 五年收益率 十年收益率
1 2023-01-30 2.435 2.723 2.913
2 2023-01-31 2.419 2.703 2.897
...........
然后我想序列号输出
XXX.to_json(orient="index", force_ascii=False)
变成下面这样子:
{"日期":1675641600000,"中国国债收益率 5 年":2.7054 ,......}
然后我想去掉时间戳:
XXX.to_json(orient="index", force_ascii=False,date_format='iso', date_unit='s')
变成了下面样子:
{"日期":"2023-02-06T00:00:00","中国国债收益率 5 年":2.7054}
但是我不需要秒级单位,我只需要到天 2023-02-06 ,要怎么才能去掉秒?求助各位大佬