<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def replace(self, col: str, searchval: str, replaceval: str):
 """ Replace a value in a column in the main dataframe :param col: column name :type col: str :param searchval: value to replace :type searchval: str :param replaceval: new value :type replaceval: str :example: ``ds.replace("mycol", "value", "new_value")`` """

        try:
            self.df[col] = self.df[col].replace(searchval, replaceval)
        except Exception as e:
            self.err(e, "Can not replace value in column")