#NEWLINE# def __init__( self , endog , exog , censors ) : #NEWLINE# #INDENT# self . nobs = np . shape ( exog ) [ 0 ] #NEWLINE# self . endog = endog . reshape ( self . nobs , 1 ) #NEWLINE# self . exog = exog . reshape ( self . nobs , ( - 1 ) ) #NEWLINE# self . censors = censors . reshape ( self . nobs , 1 ) #NEWLINE# self . nvar = self . exog . shape [ 1 ] #NEWLINE# idx = np . lexsort ( ( ( - self . censors [ : , 0 ] ) , self . endog [ : , 0 ] ) ) #NEWLINE# self . endog = self . endog [ idx ] #NEWLINE# self . exog = self . exog [ idx ] #NEWLINE# self . censors = self . censors [ idx ] #NEWLINE# self . censors [ ( - 1 ) ] = 1 #NEWLINE# self . uncens_nobs = int ( np . sum ( self . censors ) ) #NEWLINE# mask = self . censors . ravel ( ) . astype ( bool ) #NEWLINE# self . uncens_endog = self . endog [ mask , : ] . reshape ( ( - 1 ) , 1 ) #NEWLINE# self . uncens_exog = self . exog [ mask , : ]