Skip to content

for gh-49508 changing Doc for DataFrame.astype #49556

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 7 commits into from
Nov 11, 2022
Merged
Changes from 2 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
11 changes: 6 additions & 5 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6004,11 +6004,12 @@ def astype(

Parameters
----------
dtype : data type, or dict of column name -> data type
Use a numpy.dtype or Python type to cast entire pandas object to
the same type. Alternatively, use {col: dtype, ...}, where col is a
column label and dtype is a numpy.dtype or Python type to cast one
or more of the DataFrame's columns to column-specific types.
dtype : string, data type, Series or Mapping of column name -> data type
Use a data type like object (string, numpy.dtype, pandas.ExtensionDtype
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Use a data type like object (string, numpy.dtype, pandas.ExtensionDtype
Use a string, numpy.dtype, pandas.ExtensionDtype

or Python type) to cast entire pandas object to the same type. Alternatively,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
or Python type) to cast entire pandas object to the same type. Alternatively,
or Python type to cast entire pandas object to the same type. Alternatively,

use {col: dtype, ...}, where col is a column label and dtype is a
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
use {col: dtype, ...}, where col is a column label and dtype is a
use a mapping, e.g. {col: dtype, ...}, where col is a column label and dtype is a

numpy.dtype or Python type to cast one or more of the DataFrame's
columns to column-specific types.
copy : bool, default True
Return a copy when ``copy=True`` (be very careful setting
``copy=False`` as changes to values then may propagate to other
Expand Down