~/talk

On copies and views: updating pandas' internals

Talkat PyData Global 2022 · 2022-12-01..12-03· [python]
slides:none on file

Proposal simplifies pandas’ copy/view rules so any derived DataFrame or Series behaves as a copy while under‑the‑hood uses views until mutation to save memory. It aims to remove SettingWithCopyWarning, avoid defensive copies from method chains, and delay actual copying until an in‑place mutation occurs. Prototype is available behind an option pd.options.mode.copy_on_write in pandas 1.5+ so users can try the change today.

AI-written summary · about

  1. 0:00pandas internals intro
  2. 1:11Understanding the SettingWithCopyWarning
  3. 2:35Copies vs views
  4. 4:03Mutations affect originals
  5. 6:08Copy behavior problems
  6. 7:34Chained assignments pitfalls
  7. 9:46Defensive copying
  8. 11:10Method chains copies
  9. 12:55Simplified copy rules proposal
  10. 15:44New copy rules consistency
  11. 17:09Eliminating the SettingWithCopyWarning
  12. 18:54Copy-on-write explained
  13. 20:43Optimizing method chains
  14. 21:05Try new behavior
  15. 22:33Summary and feedback
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.