diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index cd109a7e..179c4d65 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -180,27 +180,32 @@ def get_rows_by_mask(self, mask: Column[Bool]) -> DataFrame: """ ... - def insert_column(self, loc: int, column: Column[Any]) -> DataFrame: + def update_columns(self, columns: Column[Any] | Sequence[Column[Any]], /) -> DataFrame: """ - Insert column into DataFrame at specified location. + Update values in existing column(s) from Dataframe. - The column's name will be used as the label in the resulting dataframe. - To insert the column with a different name, combine with `Column.rename`, + The column's name will be used to tell which column to update. + To update a column with a different name, combine with :meth:`Column.rename`, e.g.: - .. code-block :: python + .. code-block:: python new_column = df.get_column_by_name('a') + 1 - df = df.insert(0, new_column.rename('a_plus_1')) + df = df.update_column(new_column.rename('b')) Parameters ---------- - loc : int - Insertion index. Must verify 0 <= loc <= len(columns). - column : Column + columns : Column | Sequence[Column] + Column(s) to update. If updating multiple columns, they must all have + different names. + + Returns + ------- + DataFrame """ ... + def drop_column(self, label: str) -> DataFrame: """ Drop the specified column.