python - MySQLdb._exceoption.OperationalError 由于夏令时
问题描述
我无法将我的数据框上传到 mySQL 数据库。错误消息表明时移存在某种问题(我来自德国),尽管我在 utc 中创建了一个日期范围,并且我还想以 utc 时间将数据保存在我的数据库中。
谢谢你的帮助
idx = pd.date_range(start=f'{year}-01-01', periods=len(df), freq='H', tz='utc').shift(-1, freq='H')
df.set_index(idx, inplace=True)
df.to_sql('intraday_continuous', con=engine, index=True, if_exists='replace')
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1292, "Incorrect datetime value: '2019-03-31 02:00:00' for column 'index' at row 273")
解决方案
推荐阅读
- javascript - 如何在浏览器中使用threeJS渲染单个DRC文件和单个MTL文件?
- java - 如何在 join fetch QueryDSL JPAQuery 中选择?
- python - 如何在卷积神经网络中使用余弦函数作为激活函数?
- graphql - AWS Amplify GraphQL 按动态 Cognito 用户组过滤
- ios - 运行 IOS 错误“未能读取资产标签”xcode 10.13
- javascript - 在 javascript 中使用 angular-translate 库获取 i18n 翻译的关键字是什么?
- php - 使用 php 和 mysqli 创建管理员和用户帐户时遇到问题
- java - 使用 Retrofit 请求响应刷新 livedata
- sql-server - 如何避免 Group By which 在 Select 语句中包含聚合函数
- javascript - 如何使用 jQuery 删除 HTML 中的动态元素