#NEWLINE# def _predict( self , estimate , label ) : #NEWLINE# #INDENT# class_name = self . __class__ . __name__ #NEWLINE# doc_string = ( '\n          Predict the %s at certain point in time.\n\n          Parameters:\n            time: a scalar or an array of times to predict the value of %s at.\n\n          Returns:\n            predictions: a scalar if time is a scalar, a numpy array if time in an array.\n          ' % ( class_name , estimate ) ) #NEWLINE# def predict( time ) : #NEWLINE# #INDENT# predictor = ( lambda t : getattr ( self , estimate ) . ix [ : t ] . iloc [ ( - 1 ) ] [ label ] ) #NEWLINE# try : #NEWLINE# #INDENT# return np . array ( [ predictor ( t ) for t in time ] ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# return predictor ( time ) #NEWLINE# #UNINDENT# #UNINDENT# predict . __doc__ = doc_string #NEWLINE# return predict