import numpy
a = numpy.array(([3,2,1],[2,5,7],[4,7,8]))
itemindex = numpy.argwhere(a == 7)
print (itemindex)
print anumpy返回array中元素的index
最新推荐文章于 2026-04-20 05:30:45 发布
本文介绍如何使用 Python 的 numpy 库进行数组创建、数据查找等基本操作,通过实例展示 numpy 在数据处理中的高效应用。

795

被折叠的 条评论
为什么被折叠?



