Behavior of np.c_ with list and tuple arguments

Viewed 1420

The output of np.c_ differs when its arguments are lists or tuples. Consider the output of the three following lines

np.c_[[1,2]]
np.c_[(1,2)]
np.c_[(1,2),]

With a list argument, np.c_ returns a column array, as expected. When the argument is a tuple instead (second line), it returns a 2D row. Adding a comma after the tuple (third line) returns a column array as for the first call.

Can somebody explain the rationale behind this behavior?

2 Answers
Related