HTTP/2 200
date: Mon, 28 Jul 2025 05:22:06 GMT
content-type: text/html
content-encoding: gzip
last-modified: Mon, 07 Jul 2025 17:38:38 GMT
cf-cache-status: DYNAMIC
vary: accept-encoding
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=7heeqnBDmF268nCpZM6kwMagZw7RYnRSz28iP0cIqSbMDwCgjeyVGWFvD5TrzsYanJ3yUBXbBu4uFGiLV3gCSUvxmZHIBJphvoTvJWQTOVmLKnlnx2InKtXGuT0HZY9Escga"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 9661efd45fb2b080-BLR
server-timing: cfL4;desc="?proto=TCP&rtt=750&min_rtt=688&rtt_var=236&sent=6&recv=11&lost=0&retrans=0&sent_bytes=3385&recv_bytes=1023&delivery_rate=3684478&cwnd=252&unsent_bytes=0&cid=1a688f50c117217a&ts=272&x=0"
pandas.DataFrame.pop — pandas 2.3.1 documentation
Skip to main content
pandas.DataFrame.pop
-
DataFrame.pop(item)[source]
Return item and drop from frame. Raise KeyError if not found.
- Parameters:
- itemlabel
Label of column to be popped.
- Returns:
- Series
Examples
>>> df = pd.DataFrame([('falcon', 'bird', 389.0),
... ('parrot', 'bird', 24.0),
... ('lion', 'mammal', 80.5),
... ('monkey', 'mammal', np.nan)],
... columns=('name', 'class', 'max_speed'))
>>> df
name class max_speed
0 falcon bird 389.0
1 parrot bird 24.0
2 lion mammal 80.5
3 monkey mammal NaN
>>> df.pop('class')
0 bird
1 bird
2 mammal
3 mammal
Name: class, dtype: object
>>> df
name max_speed
0 falcon 389.0
1 parrot 24.0
2 lion 80.5
3 monkey NaN