#NEWLINE# def _coerce_method( converter ) : #NEWLINE# #INDENT# ' install the scalar coercion methods ' #NEWLINE# def wrapper( self ) : #NEWLINE# #INDENT# if ( len ( self ) == 1 ) : #NEWLINE# #INDENT# return converter ( self . iloc [ 0 ] ) #NEWLINE# #UNINDENT# raise TypeError ( 'cannot convert the series to {0}' . format ( str ( converter ) ) ) #NEWLINE# #UNINDENT# return converter