#NEWLINE# def count( self ) : #NEWLINE# #INDENT# obj = self . _convert_freq ( ) #NEWLINE# window = self . _get_window ( ) #NEWLINE# window = ( min ( window , len ( obj ) ) if ( not results . center ) else window ) #NEWLINE# ( blocks , obj ) = self . _create_blocks ( how = None ) #NEWLINE# results = [ ] #NEWLINE# for b in blocks : #NEWLINE# #INDENT# if com . needs_i8_conversion ( b . values ) : #NEWLINE# #INDENT# result = b . notnull ( ) . astype ( int ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# result = np . isfinite ( b ) . astype ( float ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# result = np . isfinite ( b . astype ( float ) ) . astype ( float ) #NEWLINE# #UNINDENT# result [ pd . isnull ( result ) ] = 0 #NEWLINE# #UNINDENT# result = self . _constructor ( result , window = window , min_periods = 0 , center = self . center ) . sum ( ) #NEWLINE# results . append ( result ) #NEWLINE# #UNINDENT# return self . _wrap_results ( results , blocks , obj )