def _get_dtype_from_object(dtype):
 if (isinstance(dtype, type) and issubclass(dtype, np.generic)):
  return dtype
 elif is_categorical(dtype):
  return CategoricalDtype().type
 elif is_datetimetz(dtype):
  return DatetimeTZDtype(dtype).type
 elif isinstance(dtype, np.dtype):
  try:
   _validate_date_like_dtype(dtype)
  except TypeError:
   pass
  return dtype.type
 elif isinstance(dtype, string_types):
  if (dtype in ['datetimetz', 'datetime64tz']):
   return DatetimeTZDtype.type
  elif (dtype in ['period']):
   raise NotImplementedError
  if ((dtype == 'datetime') or (dtype == 'timedelta')):
   dtype += '64'
  try:
   return _get_dtype_from_object(getattr(np, dtype))
  except (AttributeError, TypeError):
   pass
 return _get_dtype_from_object(np.dtype(dtype))

def _get_dtype_from_object ( dtype ) : if ( isinstance ( dtype , type ) and issubclass ( dtype , np . generic ) ) : return dtype elif is_categorical ( dtype ) : return CategoricalDtype ( ) . type elif is_datetimetz ( dtype ) : return DatetimeTZDtype ( dtype ) . type elif isinstance ( dtype , np . dtype ) : try : _validate_date_like_dtype ( dtype ) except TypeError : pass return dtype . type elif isinstance ( dtype , string_types ) : if ( dtype in [ 'datetimetz' , 'datetime64tz' ] ) : return DatetimeTZDtype . type elif ( dtype in [ 'period' ] ) : raise NotImplementedError if ( ( dtype == 'datetime' ) or ( dtype == 'timedelta' ) ) : dtype += '64' try : return _get_dtype_from_object ( getattr ( np , dtype ) ) except ( AttributeError , TypeError ) : pass return _get_dtype_from_object ( np . dtype ( dtype ) )
get a numpy dtype .