title: How can I always have numpy.ndarray.shape return a two valued tuple?
body: <p>I'm trying to get the values of (nRows, nCols) from a 2D Matrix but when it's a single row (i.e. x = np.array([1, 2, 3, 4])), x.shape will return (4,) and so my statement of (nRows, nCols) = x.shape returns "ValueError: need more than 1 value to unpack"</p>
  
  <p>Any suggestions on how I can make this statement more adaptable? It's for a function that is used in many programs and should work with both single row and multi-row matices. Thanks!</p>