<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_column(self, X, column, value):
 """Sets a column on the matrix X with the given value. Args: X: `numpy.ndarray` or `pandas.DataFrame`. column: `int` or `str`. value: `np.ndarray` with shape (1,) Returns: `np.ndarray` or `pandas.DataFrame` with the inserted column. """


        if isinstance(X, pd.DataFrame):
            X.loc[:, column] = value

        else:
            X[:, column] = value

        return X