#NEWLINE# def test_cov( self ) : #NEWLINE# #INDENT# self . assertAlmostEqual ( self . ts . cov ( self . ts ) , ( self . ts . std ( ) ** 2 ) ) #NEWLINE# self . assertAlmostEqual ( self . ts [ : 15 ] . cov ( self . ts [ 5 : ] ) , ( self . ts [ 5 : 15 ] . std ( ) ** 2 ) ) #NEWLINE# self . assertTrue ( np . isnan ( self . ts [ : : 2 ] . cov ( self . ts [ 1 : : 2 ] ) ) ) #NEWLINE# cp = self . ts [ : 10 ] . copy ( ) #NEWLINE# cp [ : ] = np . nan #NEWLINE# self . assertTrue ( isnull ( cp . cov ( cp ) ) ) #NEWLINE# self . assertTrue ( isnull ( self . ts [ : 15 ] . cov ( self . ts [ 5 : ] , min_periods = 12 ) ) ) #NEWLINE# ts1 = self . ts [ : 15 ] . reindex ( self . ts . index ) #NEWLINE# ts2 = self . ts [ 5 : ] . reindex ( self . ts . index ) #NEWLINE# self . assertTrue ( isnull ( ts1 . cov ( ts2 , min_periods = 12 ) ) )