7 Jan
2023
7 Jan
'23
4:23 p.m.
with 3 examples (i added one for sorting) it gives a correct answer on colab npapi.set_example( '''Construct an array B that repeats array Y 4 times along the last dimension.''', '''B = np.tile(Y, 4)''' ) npapi.set_example( '''Swap the last two axes of an array D.''', '''D = D.swapaxes(-2, -1)''' ) npapi.set_example( '''Sort an array along the third axis.''', '''array.sort(3)''' ) Reverse an array C.: 'C = np.flipud(C)' I didn't even know about the flipud function until now, which appears to default to selecting the outermost axis rather than all of them. This is likely the meaning of the word reverse.