plmsql AttributeError: 'numpy.int64' object has no attribute 'translate'
时间: 2023-10-02 21:04:46 浏览: 93
PyQt学习随笔:自定义信号连接时报AttributeError: ‘PyQt5.QtCore.pyqtSignal’ object has no attribute ‘connect’
5星 · 资源好评率100%
这个错误是由于'numpy.int64'对象没有'translate'属性引起的。这个错误通常在使用pandas库的to_sql方法写入数据库时出现。根据引用提供的解决方案,你可以尝试使用astype(int)来将数据类型转换为整数类型,然后再写入数据库。这样可以避免出现'translate'属性错误。另外,引用中的参考文章也可以帮助你解决这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [解决pyfolio报错AttributeError: ‘numpy.int64‘ object has no attribute ‘to_pydatetime](https://blog.csdn.net/Yangxh2004/article/details/121451734)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [另一种解决AttributeError: ‘numpy.int64‘ object has no attribute ‘translate‘的方法](https://blog.csdn.net/LM813381916/article/details/115528796)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文