How to determine the a.shape without specified

"Can I ask why a.shape was not specified previously and how the resulting shape of (3,1) was obtained instead of (1,3) ?

Look carefully at the use of the square brackets in the call to np.array() and see also:

https://numpy.org/doc/stable/reference/generated/numpy.array.html

Ok Thank you~
best regards