Skip to content

Commit

Permalink
rename insert, remove label argument (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored Aug 22, 2023
1 parent 192901a commit cafa8fd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions spec/API_specification/dataframe_api/dataframe_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
...

Expand Down

0 comments on commit cafa8fd

Please sign in to comment.