+ 1

Playing with NumPy

https://code.sololearn.com/cfEGBBQKlJb4/?ref=app What is a[None]? Why it is [[1 2 3 4 5]]? Code: import numpy as np a = np.array(range(6)) print(a) print(a[None]) Output: [1 2 3 4 5] [[1 2 3 4 5]]

10th Dec 2018, 9:38 PM
portpass
2 odpowiedzi
0
It's so simple! a[None] is a[None, :, :]! But it seemed really strange and unclear last night, when I was sleeppy ;)
11th Dec 2018, 6:46 AM
portpass