MCPcopy
hub / github.com/pandas-dev/pandas / pop

Method pop

pandas/core/series.py:5790–5821  ·  view source on GitHub ↗

Return item and drops from series. Raise KeyError if not found. Parameters ---------- item : label Index of the element that needs to be removed. Returns ------- scalar Value that is popped from series. See A

(self, item: Hashable)

Source from the content-addressed store, hash-verified

5788 )
5789
5790 def pop(self, item: Hashable) -> Any:
5791 """
5792 Return item and drops from series. Raise KeyError if not found.
5793
5794 Parameters
5795 ----------
5796 item : label
5797 Index of the element that needs to be removed.
5798
5799 Returns
5800 -------
5801 scalar
5802 Value that is popped from series.
5803
5804 See Also
5805 --------
5806 Series.drop: Drop specified values from Series.
5807 Series.drop_duplicates: Return Series with duplicate values removed.
5808
5809 Examples
5810 --------
5811 >>> ser = pd.Series([1, 2, 3])
5812
5813 >>> ser.pop(0)
5814 1
5815
5816 >>> ser
5817 1 2
5818 2 3
5819 dtype: int64
5820 """
5821 return maybe_unbox_numpy_scalar(super().pop(item=item))
5822
5823 def info(
5824 self,

Callers 15

test_popFunction · 0.95
get_versions_from_codeFunction · 0.45
get_versions_from_tomlFunction · 0.45
find_titlesFunction · 0.45
get_callableFunction · 0.45
git_pieces_from_vcsFunction · 0.45
load_reduceMethod · 0.45
load_newobjMethod · 0.45
_get_call_argsMethod · 0.45
__call__Method · 0.45

Calls 1

maybe_unbox_numpy_scalarFunction · 0.90

Tested by 15

test_popFunction · 0.76
test_timesMethod · 0.36
test_times_arrayMethod · 0.36
_check_plot_worksFunction · 0.36
__init__Method · 0.36
test_join_index_seriesFunction · 0.36
test_popMethod · 0.36
test_mixed_depth_popMethod · 0.36
test_encodeMethod · 0.36