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

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

merged 7 commits into from
Nov 11, 2022

Conversation

ramvikrams
Copy link
Contributor

@ramvikrams ramvikrams commented Nov 6, 2022

added the series in input in the doc of DataFrame.astype

closes #49508

added the series in input in the doc of DataFrame.astype
@ramvikrams ramvikrams changed the title for #49508 changing Doc for DataFrame.astype for gh-49508 changing Doc for DataFrame.astype Nov 6, 2022
@mroeschke mroeschke added the Docs label Nov 7, 2022
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 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
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,

dtype : string, data type, Series or Mapping of column name -> data type
Use a data type like object (string, numpy.dtype, pandas.ExtensionDtype
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

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Also appears to be some code check failures

@ramvikrams
Copy link
Contributor Author

Also appears to be some code check failures

Thanks I'll fix them up

@ramvikrams
Copy link
Contributor Author

Done the changes sir

@mroeschke
Copy link
Member

Looks to be some validation errors:

Error: /home/runner/work/pandas/pandas/pandas/core/generic.py:5999:PR06:pandas.DataFrame.astype:Parameter "dtype" type should use "str" instead of "string"
Error: /home/runner/work/pandas/pandas/pandas/core/generic.py:5999:PR06:pandas.Series.astype:Parameter "dtype" type should use "str" instead of "string"

@ramvikrams
Copy link
Contributor Author

Looks to be some validation errors:

Error: /home/runner/work/pandas/pandas/pandas/core/generic.py:5999:PR06:pandas.DataFrame.astype:Parameter "dtype" type should use "str" instead of "string"
Error: /home/runner/work/pandas/pandas/pandas/core/generic.py:5999:PR06:pandas.Series.astype:Parameter "dtype" type should use "str" instead of "string"

Sir I didn't understand how can a validation error come from line 5999 when I did not even change the line, seems strange.

@mroeschke
Copy link
Member

This is a shared docstring so it's used by 2 other functions. I think string should be be str as mentioned in the message

@ramvikrams
Copy link
Contributor Author

This is a shared docstring so it's used by 2 other functions. I think string should be be str as mentioned in the message

thanls sir done the changes

@mroeschke mroeschke added this to the 2.0 milestone Nov 11, 2022
@mroeschke mroeschke merged commit a23eb83 into pandas-dev:main Nov 11, 2022
@mroeschke
Copy link
Member

Thanks @ramvikrams

@ramvikrams
Copy link
Contributor Author

Thanks @ramvikrams

Thank you sir for your help all along

codamuse pushed a commit to codamuse/pandas that referenced this pull request Nov 12, 2022
…49556)

* for pandas-dev#49508 changing Doc for DataFrame.astype

added the series in input in the doc of DataFrame.astype

* up

* up2

* up3

* up4

* up5
mliu08 pushed a commit to mliu08/pandas that referenced this pull request Nov 27, 2022
…49556)

* for pandas-dev#49508 changing Doc for DataFrame.astype

added the series in input in the doc of DataFrame.astype

* up

* up2

* up3

* up4

* up5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: make clear that DataFrame.astype supports Series input
2 participants