python - 我在将数据插入 mysql 数据库时遇到错误,这是技术领域的新手,正在为我寻找某人
问题描述
with open('housePrice.csv','r') as f:
data=csv.reader(f,delimiter='\n')
for lines in enumerate(data):
for list_ in (lines[1]):
cursor.execute('insert into testineuron.houseprice values({values})'.format(values=list_))
mydb.commit()
houseprice.csv 中的数据 ->
63,1,True,True,True,Shahran,1850000000.0,61666.67
错误->
ProgrammingError: 1054 (42S22): Unknown column 'Shahran' in 'field list'
解决方案
推荐阅读
- apache-spark - spark.executor.memoryOverhead 和 spark.memory.offHeap.size 的区别
- javascript - 如何在 React JS 中设置默认全局配置 axios
- javascript - 散景 - 在回调期间更新 Div 文本
- javascript - 有没有办法改变 WebAudio 中监听器的平移平衡?
- javascript - 谁能告诉我这个套接字事件有什么问题?
- laravel - 如何在 Laravel 中收听 Postgres 收听/通知?
- python - 获取列表python中元素的总和
- python - 谁能告诉我这个列表理解有什么问题?
- mongodb - 如何在MongoDB中存储时间段
- sql - Angular SPA - REST API