<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def weld_replace(array, weld_type, this, to):
 """Replaces 'this' values to 'to' value. Parameters array : numpy.ndarray or WeldObject Input array. weld_type : WeldType Type of the data in the array. this : {int, float, str, bool, bytes} Scalar to replace. to : {int, float, str, bool, bytes} Scalar to replace with. Returns ------- WeldObject Representation of this computation. """

    if not isinstance(this, str):
        this = to_weld_literal(this, weld_type)
    to = to_weld_literal(to, weld_type)

    obj_id, weld_obj = create_weld_object(array)

    weld_template = """map({array},
    |e: {type}|
        if(e == {this},
            {to},
            e
        )    
)"""

    weld_obj.weld_code = weld_template.format(array=obj_id,
                                              type=weld_type,
                                              this=this,
                                              to=to)

    return weld_obj