Skip to content

Commit

Permalink
address reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
galipremsagar committed Feb 14, 2022
1 parent 334eb4d commit d3e062f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,10 @@ def insert(self, loc, name, value, nan_as_null=None):
name : number or string
name or label of column to be inserted
value : Series or array-like
nan_as_null : bool, Default None
If ``None``/``True``, converts ``np.nan`` values to
``null`` values.
If ``False``, leaves ``np.nan`` values as is.
"""
return self._insert(
loc=loc,
Expand All @@ -2564,7 +2568,16 @@ def insert(self, loc, name, value, nan_as_null=None):
)

@annotate("DATAFRAME__INSERT", color="green", domain="cudf_python")
def _insert(self, loc, name, value, nan_as_null=None, ignore_index=False):
def _insert(self, loc, name, value, nan_as_null=None, ignore_index=True):
"""
Same as `insert`, with additional `ignore_index` param.
ignore_index : bool, default True
If True, there will be no index equality check & reindexing
happening.
If False, a reindexing operation is performed if
`value.index` is not equal to `self.index`.
"""
if name in self._data:
raise NameError(f"duplicated column name {name}")

Expand Down

0 comments on commit d3e062f

Please sign in to comment.