def _align_nums(nums):
 try:
  nums = asarray(nums)
  if (not np.issubdtype(nums.dtype, np.number)):
   raise ValueError('dtype of numerator is non-numeric')
  return nums
 except ValueError:
  nums = [np.atleast_1d(num) for num in nums]
  max_width = max((num.size for num in nums))
  aligned_nums = np.zeros((len(nums), max_width))
  for (index, num) in enumerate(nums):
   aligned_nums[index, (- num.size):] = num
  return aligned_nums

def _align_nums ( nums ) : try : nums = asarray ( nums ) if ( not np . issubdtype ( nums . dtype , np . number ) ) : raise ValueError ( 'dtype of numerator is non-numeric' ) return nums except ValueError : nums = [ np . atleast_1d ( num ) for num in nums ] max_width = max ( ( num . size for num in nums ) ) aligned_nums = np . zeros ( ( len ( nums ) , max_width ) ) for ( index , num ) in enumerate ( nums ) : aligned_nums [ index , ( - num . size ) : ] = num return aligned_nums
aligns the shapes of multiple numerators .