Python any函数
来源:互联网 发布:java参数引用传递 编辑:程序博客网 时间:2024/04/29 18:18
(a.loc[i,['Count']]==y_count[1])#输出
#Out[391]: #Count True#Name: 1, dtype: bool
if(a.loc[i,['Count']]==y_count[1]):print("da")Traceback (most recent call last):
File "<ipython-input-390-0a73d4feade7>", line 1, in <module>
if(a.loc[i,['Count']]==y_count[1]):print("da")
File "C:\Anaconda34\lib\site-packages\pandas\core\generic.py", line 731, in __nonzero__
.format(self.__class__.__name__))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
if any((a.loc[i,['Count']]==y_count[2])):print("da")if any((a.loc[i,['Count']]==y_count[1])):print("da")da
这里和迭代器有关的问题。用到了any函数、empty函数、all函数。
好吧,之后想起来补充
0 0
- Python any函数
- python: all & any 函数
- Python标准库:内置函数any(iterable)
- python中的函数any()和all()
- python中的函数any()和all()
- python内建函数any()和all()
- Python的内置函数---ascii,abs,any
- python any
- Python内建函数(A) all(iterable) any(iterable)
- python函数日积月累 basestring()、any()、all()、callable()、divmod()
- Python内置函数学习(3)-any(itearable)
- 不曾见过的Python函数——any(),all()
- Python numpy函数:all()和any()比较矩阵
- python any用法
- python any和all
- all、any函数
- Malta中any函数
- Any函数使用小记
- MongoDB常用操作命令大全
- C语言基础 进制的转换
- servlet 的destroy什么时候调用
- 微信开发中用dom4j解析消息时的错误
- 强制IE浏览器或WebBrowser控件使用指定版本显示网页
- Python any函数
- 浅析MVP模式
- 随机出数并排列
- android native hook 源码 及 解析
- Java Swing中的组件用final修饰
- Linux: apt-get vs aptitude and 'ldconfig' problem solving (libc-bin package)
- 1
- 十个数有序排列
- 2. Add Two Numbers 【M】【72】【leetcode】