diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index 8a25a8c1..b0f70b43 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -180,17 +180,24 @@ def get_rows_by_mask(self, mask: Column[Bool]) -> DataFrame: """ ... - def insert(self, loc: int, label: str, value: Column[Any]) -> DataFrame: + def insert_column(self, loc: int, column: Column[Any]) -> DataFrame: """ Insert column into DataFrame at specified location. + 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`, + e.g.: + + .. code-block :: python + + new_column = df.get_column_by_name('a') + 1 + df = df.insert(0, new_column.rename('a_plus_1')) + Parameters ---------- loc : int Insertion index. Must verify 0 <= loc <= len(columns). - label : str - Label of the inserted column. - value : Column + column : Column """ ...