File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -5135,9 +5135,30 @@ def delete(self, loc):
5135
5135
"""
5136
5136
Make new Index with passed location(-s) deleted.
5137
5137
5138
+ Parameters
5139
+ ----------
5140
+ loc : int or list of int
5141
+ Location of item(-s) which will be deleted.
5142
+ Use a list of locations to delete more than one value at the same time.
5143
+
5138
5144
Returns
5139
5145
-------
5140
- new_index : Index
5146
+ Index
5147
+ New Index with passed location(-s) deleted.
5148
+
5149
+ See Also
5150
+ --------
5151
+ numpy.delete : Delete any rows and column from NumPy array (ndarray).
5152
+
5153
+ Examples
5154
+ --------
5155
+ >>> idx = pd.Index(['a', 'b', 'c'])
5156
+ >>> idx.delete(1)
5157
+ Index(['a', 'c'], dtype='object')
5158
+
5159
+ >>> idx = pd.Index(['a', 'b', 'c'])
5160
+ >>> idx.delete([0, 2])
5161
+ Index(['b'], dtype='object')
5141
5162
"""
5142
5163
return self ._shallow_copy (np .delete (self ._data , loc ))
5143
5164
You can’t perform that action at this time.
0 commit comments