Python localtime,TypeError:无法将序列转换为

问题描述 投票:0回答:1

我有一个DataFrame:enter image description here

我想在本地时间显示“ TimeStamps”,但不运行。

time.localtime(data_user['TimeStamps'].astype(int))

错误:

TypeError: cannot convert the series to <class 'int'>

我该怎么做?

python typeerror localtime
1个回答
0
投票

使用箭头包

from datetime import datetime
import arrow

now = datetime.utcnow()

print(arrow.get(now).to('local').format())
# 2020-04-25 15:55:31+01:00
© www.soinside.com 2019 - 2024. All rights reserved.