如何创建 pandas 'now' Timestamp
为了创建表示当前时间点的 pandas Timestamp,使用
pandas_now_example.py
pd.Timestamp('now')这将在当前时区创建 Timestamp。
完整示例:
pandas_now_full_example.py
import pandas as pd
now = pd.Timestamp('now')
print(now) # 打印例如 Timestamp('2020-05-25 19:02:31.051836')If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow