python - 是否有 DolphinDB 函数用于查找向量中元素的索引?

标签 python search dolphindb

在python中,我可以使用index来查找元素的索引,例如:

# vowels list
vowels = ['a', 'e', 'i', 'o', 'i', 'u']

# index of 'e'
index = vowels.index('e')
print('The index of e:', index)

# index of the first 'i'
index = vowels.index('i')
print('The index of i:', index)

DolphinDB中有等效的函数吗?

最佳答案

使用函数find获取向量中元素的索引。如果该元素不存在,则返回-1。

vowels = ['a', 'e', 'i', 'o', 'i', 'u']
index = vowels.find('e')

关于python - 是否有 DolphinDB 函数用于查找向量中元素的索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60368295/

相关文章:

python - 用于计算间隔的工具/库,如 "last thursday of the month"

python - 如何将python源代码转换为C++源代码

php - 在 foreach 中查询没有结果

mysql - 在同一行中搜索多个模式

dolphindb - 如何删除dfs表中的重复数据?

row - DolphinDB数据库中每一行的所有列的总和

matlab - 线性规划求解器中上限和下限的参数

python - 使用 python 3 提取 7z 文件

python - python3.7 pypi-server:SSLCertVerificationError:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败:无法获取本地发行者证书

PHP/MYSQL - 需要更好的方法来处理此全文搜索查询