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
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.