<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def score_string( self, string ):
 """ Score each valid position in `string` using this scoring matrix. Positions which were not scored are set to nan. """

        rval = zeros( len( string ), float32 )
        rval[:] = nan
        _pwm.score_string( self.values, self.char_to_index, string, rval )
        return rval