Skip to content

DEPR: restore to_frame() name=None behaviour but deprecate it #45523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

jorisvandenbossche
Copy link
Member

Closes #45448

@jorisvandenbossche jorisvandenbossche added Regression Functionality that used to work in a prior pandas version Deprecate Functionality to remove in pandas labels Jan 21, 2022
@jorisvandenbossche jorisvandenbossche added this to the 1.4 milestone Jan 21, 2022
Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

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

lgtm

@jreback jreback merged commit b2da0a7 into pandas-dev:main Jan 21, 2022
@jreback
Copy link
Contributor

jreback commented Jan 21, 2022

@meeseeksdev backport 1.4.x

@lumberbot-app
Copy link

lumberbot-app bot commented Jan 21, 2022

Something went wrong ... Please have a look at my logs.

@@ -696,6 +696,7 @@ Other Deprecations
- Deprecated the behavior of :meth:`Timestamp.utcfromtimestamp`, in the future it will return a timezone-aware UTC :class:`Timestamp` (:issue:`22451`)
- Deprecated :meth:`NaT.freq` (:issue:`45071`)
- Deprecated behavior of :class:`Series` and :class:`DataFrame` construction when passed float-dtype data containing ``NaN`` and an integer dtype ignoring the dtype argument; in a future version this will raise (:issue:`40110`)
- Deprecated the behaviour of :meth:`Series.to_frame` and :meth:`Index.to_frame` to ignore the ``name`` argument when ``name=None``. Currently, this means to preserve the existing name, but in the future explicitly passing ``name=None`` will set ``None`` as the name of the column in the resulting DataFrame (:issue:`44212`)
Copy link
Member

Choose a reason for hiding this comment

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

"to ignore the name argument when"

wording is kind of awkward, sounds like ignoring the argument is the future behavior. The next sentence clarifies this well. Could reword as just "with ``name=None``"

jreback pushed a commit that referenced this pull request Jan 21, 2022
rapids-bot bot pushed a commit to rapidsai/cudf that referenced this pull request Aug 30, 2024
In pandas 2.0, `to_frame(name=None)` allowed the resulting column name to be `None` pandas-dev/pandas#45523

Looks like based on the current default of `cudf.Series.to_frame`, this behavior was not reflected.

Additionally, created a `SingleColumnFrame._to_frame` to more easily share the logic between `Series.to_frame` and `Index.to_frame`

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #16698
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REGR: to_frame with name=None no longer gives default name
4 participants