Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions doc/source/user_guide/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ A different alternative would be to not use ``inplace``:
df["foo"] = df["foo"].replace(1, 5)
df

**Column attributes cannot be used to store column-level metadata**

``DataFrame.attrs`` and ``Series.attrs`` remain available for metadata on the
object itself. With CoW, setting ``attrs`` on a ``Series`` returned by selecting
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to CoW, it’s the removal of the item_cache

a :class:`DataFrame` column is not a supported way to attach metadata to that
column. A future access to the same column may return a different ``Series``
object without those attributes.
Comment on lines +155 to +158
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
object itself. With CoW, setting ``attrs`` on a ``Series`` returned by selecting
a :class:`DataFrame` column is not a supported way to attach metadata to that
column. A future access to the same column may return a different ``Series``
object without those attributes.
object itself. Previously, setting ``attrs`` on a ``Series`` returned by selecting
a :class:`DataFrame` column would work in some cases due to
internal caching; such caching has been removed and is not a supported way
to attach metadata to that column. A future access to the same column will
now return a different ``Series`` object without those attributes.


If you need column-level metadata, store it on the parent :class:`DataFrame`
(for example in ``df.attrs["columns"]`` keyed by column name) or in a separate
metadata object that you manage alongside the :class:`DataFrame`.

**Constructors now copy NumPy arrays by default**

The Series and DataFrame constructors now copies a NumPy array by default when not
Expand Down