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

问题描述 投票:1回答:1

在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中是否有等效功能?

python search dolphindb
1个回答
0
投票

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

vowels = ['a', 'e', 'i', 'o', 'i', 'u']
index = vowels.find('e')
© www.soinside.com 2019 - 2024. All rights reserved.