def _get_const_index(exog):
 effects_idx = (exog.var(0) != 0)
 if np.any((~ effects_idx)):
  const_idx = np.where((~ effects_idx))[0]
 else:
  const_idx = None
 return (effects_idx, const_idx)

def _get_const_index ( exog ) : effects_idx = ( exog . var ( 0 ) != 0 ) if np . any ( ( ~ effects_idx ) ) : const_idx = np . where ( ( ~ effects_idx ) ) [ 0 ] else : const_idx = None return ( effects_idx , const_idx )
returns a boolean array of non-constant column indices in exog and an scalar array of where the constant is or none .