最近有需要将分钟线的数据进行内联拼接,但时间没有必要精确到秒,微秒。

    df['datetime'] = pd.to_datetime(df['datetime'])
    df = df.set_index('datetime')
    df.index = df.index.map(lambda x: x.replace(second=0, microsecond=0))
    import datetime
    datetime.datetime.now().replace(second=0, microsecond=0)

相关文章:

  • 2022-12-23
  • 2022-02-28
  • 2022-12-23
  • 2021-08-27
  • 2021-04-07
  • 2021-10-03
  • 2022-12-23
猜你喜欢
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2022-02-02
  • 2023-02-23
  • 2022-01-08
相关资源
相似解决方案