如何在 Pandas 中获取当前时间戳

Use

current_timestamp_pandas.py
import pandas as pd

current_timestamp = pd.Timestamp.now()

pd.Timestamp.now() 将以 pandas.Timestamp 对象返回时间戳。

示例:

timestamp_example.py
>>> import pandas as pd
>>> pd.Timestamp.now()
Timestamp('2019-10-27 16:11:43.998993')

Check out similar posts by category: Pandas, Python