python-3.x - Data_load_utility 问题 TypeError:+ 不支持的操作数类型:“NoneType”和“str”
问题描述
我正在使用数据加载实用程序并出现错误。
此方法是我在 github 中加载数据的一个实用程序的一部分。我将它用于不同的场景。此实用程序中的几乎所有功能都会导致相同的问题。将 Python 3.x 与 Juypter 笔记本一起使用。
代码:
@staticmethod
def load_shampoo_data(connection, schema=None, batch_size=10000, force=False,train_percentage=1.0,valid_percentage=0.0,test_percentage=0.0):
if schema is None:
schema = Settings.user
full_tbl = "SHAMPOO_SALES_DATA_TBL"
tables = [full_tbl]
fq_tables = [schema + '.' + tbl for tbl in tables]
cols = '( \
ID INTEGER NULL,\
SALES DOUBLE NULL\
)'
inlist = '("ID", "SALES") \
VALUES (?, ?)'
DataSets.load_data_auto(connection, fq_tables, cols, inlist,'../datasets/shampoo.csv',train_percentage,valid_percentage,test_percentage, batch_size,force)
if len(tables) == 1:
return tables[0]
return tuple(tables)
我得到的错误:
----> 1 data_tbl = DataSets.load_shampoo_data(connection_context) 中的 TypeError Traceback (最近一次调用最后一次)
C:\dir python util\data_load_utils.py in load_shampoo_data(connection, schema, batch_size, force, train_percentage, valid_percentage, test_percentage) 630 full_tbl = "SHAMPOO_SALES_DATA_TBL" 631 个表 = [full_tbl] --> 632 fq_tables = [schema + '。 ' + tbl for tbl in tables] 633 cols = '(
634 ID INTEGER NULL,\C:\dir python util\data_load_utils.py in (.0) 630 full_tbl = "SHAMPOO_SALES_DATA_TBL" 631 个表 = [full_tbl] --> 632 fq_tables = [schema + '.' + tbl for tbl in tables] 633 cols = '(
634 ID INTEGER NULL,\类型错误:+ 不支持的操作数类型:“NoneType”和“str”
解决方案
推荐阅读
- python - 问题 - Tkinter 需要检查输入框中的值是否已经在我的 sqlite 数据库表的特定列中
- android - 如何旋转使用 canvas.drawTextOnPath() 绘制的文本?
- javascript - 如何从外部 javascript 文件中调用用 Angular 组件编写的函数?
- javascript - 联系表格有时会发送空白电子邮件,尽管工作正常
- jenkins - Jenkins 构建不会从 XL 版本触发
- ios - dyld:库未加载:@rpath/libswiftCore.dylib - Ionic | Razorpay 科尔多瓦
- angularjs - “堆栈空间不足”使用 IE11、angularjs 和 highcharts-ng 插件
- variables - 时间扭曲变量初始化?
- git - git checkout remotes/origin/branch 和 git checkout branch 有什么区别?
- google-sheets - Google Spreasheet:将两列中的唯一值合并为一列