def column_stack(tup):
 if any(((not isinstance(a, cupy.ndarray)) for a in tup)):
  raise TypeError('Only cupy arrays can be column stacked')
 lst = list(tup)
 for (i, a) in enumerate(lst):
  if (a.ndim == 1):
   a = a[:, cupy.newaxis]
   lst[i] = a
  elif (a.ndim != 2):
   raise ValueError('Only 1 or 2 dimensional arrays can be column stacked')
 return concatenate(lst, axis=1)

def column_stack ( tup ) : if any ( ( ( not isinstance ( a , cupy . ndarray ) ) for a in tup ) ) : raise TypeError ( 'Only cupy arrays can be column stacked' ) lst = list ( tup ) for ( i , a ) in enumerate ( lst ) : if ( a . ndim == 1 ) : a = a [ : , cupy . newaxis ] lst [ i ] = a elif ( a . ndim != 2 ) : raise ValueError ( 'Only 1 or 2 dimensional arrays can be column stacked' ) return concatenate ( lst , axis = 1 )
stacks 1-d and 2-d arrays as columns into a 2-d array .