如何解决numpy中切片和数组索引的组合
查看以下问题的答案:How to understand numpy's combined slicing and indexing example
我仍然无法理解切片和两个1d数组的组合的索引结果,如下所示:
import SwiftUI
struct TestList: View {
var body: some View {
NavigationView{
List {
Text("hello world")
Text("hello world")
Text("hello world")
}
.listStyle(PlainListStyle())
.navigationBarTitle(Text("Test List"),displayMode:.inline)
.navigationBarItems(leading:
Image(systemName: "bell")
)
}
}
}
struct TestList_Previews: PreviewProvider {
static var previews: some View {
TestList()
}
}
为什么结果等于这个?
>>> m = np.arange(36).reshape(3,3,4)
>>> m
array([[[ 0,1,2,3],[ 4,5,6,7],[ 8,9,10,11]],[[12,13,14,15],[16,17,18,19],[20,21,22,23]],[[24,25,26,27],[28,29,30,31],[32,33,34,35]]])
>>> m[1:3,[2,1],1]]
array([[22,17],[34,29]])
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。