Implicit transposing in numpy array indexing
问题 I came across a weird problem: from numpy import zeros, arange aa = zeros([1, 3, 10]) aa[0, :, arange(5)].shape Running this gives me (5,3) , but I'm expecting (3,5) . However, running the following gives me (3,5) as expected. aa = zeros([3, 10]) aa[:, arange(5)] This is easy to fix as part of my program, but it completely ruined my belief. I tried to search for similar questions that have already been answered but have no idea what to search for. Thank you and Happy Chinese New Year! 回答1: