4 ms·
Why not just: v = np.array([2,3,1]).T is there something wrong with numpys convenience method for transpose but not matlabs postfix unary convenience operator?
by tombone12 10y ago
Why not just:
v = np.array([2,3,1]).T
is there something wrong with numpys convenience method for transpose but not matlabs postfix unary convenience operator?
- sampo 10y agoYou are right, T would be nicer than np.tranpose. But the first google hit on 'numpy transpose' [1] doesn't give that as as example. Also you too made the same mistake: np.array([2,3,1]).T doesn't do anything, you need np.array([[2,3,1]]).T [1] https://docs.scipy.org/doc/numpy/reference/generated/numpy.transpose.html https://docs.scipy.org/doc/numpy/reference/generated/numpy.t...
- brudgers 10y agoI think that's kindasorta of reason for Ng's preference: students will focus on the subject of machine learning and not spend time on the ins and outs of Python and Numpy (or these days TensorFlow). It's the same sort of pedagogical approach that keeps SML as an active teaching language. When someone googles Matlab/Octave there won't be the same mixture of contexts as there is for Python. With Python there's "2 or 3?" before even starting. Than Cython or Jython or PyPy? That's nothing against Python except that in one particular time limited context, the questions are a distraction {without even considering the complaints of students when the choice of Python implementation is contrary to their opinion}.