python 报 KeyError: ('coupon_type', 'occurred at index act_code')故障
2018-01-15 20:09
627 查看
在使用lambda函数时,系统报 KeyError: ('coupon_type', 'occurred at index act_code') 故障
原语句:
data2['type_10001']=data2.apply(lambda x:1 if x['coupon_type']==10001 else 0)
根据故障原因,修改语句为
data2['type_10001']=data2.apply(lambda x:1 if x['coupon_type']==10001 else 0,axis=1)
运行成功
原语句:
data2['type_10001']=data2.apply(lambda x:1 if x['coupon_type']==10001 else 0)
根据故障原因,修改语句为
data2['type_10001']=data2.apply(lambda x:1 if x['coupon_type']==10001 else 0,axis=1)
运行成功
相关文章推荐
- Java Project提示"Errors occurred during the build. Excepted to find an object at table index”
- An error occurred at line: 7 in the generated java file Only a type can be imported. java.util.list
- 报错:An error occurred at line: 22 in the generated java file The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory
- boss开发Caused by: java.lang.AssertionError: 没有找到actTypeCode = ReplacePhysicalResourceTestAct对应的IActio
- python 调用super()初始化报错“TypeError: super() takes at least 1 argument”
- python 调用super()初始化报错“TypeError: super() takes at least 1 argument”
- 关于Uncaught TypeError: type is not a function at HTMLAnchorElement.onclick (indexjsp:71)的解决
- HTTP Status 500 - An exception occurred processing JSP page /index.jsp at line 177
- An error occurred at line: 307 in the generated java file The code of method _jspService (HttpServle
- python pip install 报错TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' Command "python setup.py egg_info" failed with error code 1 in
- RuntimeException - Unmarshalling unknown type code **** at offset ****
- python ValueError: unsupported format character ''' (0x27) at index 224
- Uncaught TypeError: download is not a function at HTMLAnchorElement.onclick (index.html:25)
- An error occurred when merging assemblies: ILMerge.Merge: ERROR!!: Duplicate type 'index' found in a
- TypeCode To Type
- python - summary with code on OptionParse program
- Codeforces Round #376 (Div. 2) A. Night at the Museum【模拟】
- Show me the code之Python练习册 Q11~12 关键词过滤
- Python正则表达式(增加详细示例code)
- 终极解决方案 at org.apache.jsp.index_jsp._jspInit(index_jsp.java:22) 报空指针