Subject.iloc[1, 0] is equal to
datetime.time(13, 16, 14, 336000)
和
Subject.iloc[2, 0] is equal to
datetime.time(13, 16, 14, 338000)
我要做的就是找到从 Subject.iloc[1, 0] 到 Subject.iloc[2, 0] 的经过时间。但是当我减去它们时,它会说
Subject.iloc[1, 0]-Subject.iloc[2, 0]
TypeError: unsupported operand type(s) for -: 'datetime.time' and 'datetime.time'
但后来我想也许我应该使用时间增量
pd.to_timedelta(Subject.iloc[2, 0].astype(str))
上面写着 AttributeError: 'datetime.time' 对象没有属性 'astype'
谁能帮我这个?我做错了什么?
甚至这个
pd.to_timedelta(Subject.iloc[2, 0]) won't work
牧羊人nacy
明月笑刀无情
相关分类