python - 在 dataframe.time 上运行自相关,包括小时和分钟
问题描述
我正在尝试autocorrelation_plot
在 python 中的数据帧上运行。数据格式为:
2 07:38:30
3 06:32:30
4 07:36:30
5 06:52:30
6 06:47:00
...
273 07:14:30
274 08:47:30
280 08:37:00
281 09:21:30
284 08:10:30
Name: endTime, Length: 199, dtype: object
我只能通过使用 .hour 转换才能在小时内运行它:
df_valid.endTime = pd.to_datetime(df_valid.endTime, format='%Y-%m-%dT%H:%M:%S').dt.hour
fig, ax = plt.subplots(figsize=(20, 10))
autocorrelation_plot(df_valid.endTime, ax=ax)
但我也想包括会议记录,以便更准确。但是,当我尝试不先进行 .hour 转换时,我得到了TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.time'
关于为什么的任何想法?
解决方案
推荐阅读
- python - 与 tensorflow-gpu 1.4 一起使用的 keras 版本
- c# - 如何在 ASP.NET Core 集成测试中覆盖来自其他容器的 DI 注册
- ios - Swift - CollectionViewCell 边框错误或不完整
- azure-devops - VSTS Windows 机器文件复制 robocopy 未找到
- sql - 如何获取列值的总和作为 SQL 结果集中的新列
- javascript - 如何更改猫头鹰轮播中的视频背景图像?
- javascript - 不稳定的鼠标进入/鼠标离开子菜单
- r - R: na 在 ifelse
- azure - 具有任意磁盘大小的托管磁盘计费
- mysql - 这段 SQL 代码有什么问题?(VBA MS 访问)