Skip to content

Remove incorrect line in Series init docstring #61849

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
Jul 14, 2025

Conversation

petern48
Copy link
Contributor

@petern48 petern48 commented Jul 14, 2025

Copied over from the issue for convenience

    dtype : str, numpy.dtype, or ExtensionDtype, optional
        Data type for the output Series. If not specified, this will be
        inferred from `data`.
        See the :ref:`user guide <basics.dtypes>` for more usages.
        If ``data`` is Series then is ignored.

The last line here is incorrect. specifying a dtype will override the default behavior. See this example

>>> import pandas as pd
>>> ser = pd.Series([1,2,3])
>>> ser
0    1
1    2
2    3
dtype: int64
>>> pd.Series(ser, dtype=float)
0    1.0
1    2.0
2    3.0
dtype: float64

@petern48 petern48 marked this pull request as ready for review July 14, 2025 02:58
@arthurlw arthurlw added the Docs label Jul 14, 2025
@jbrockmendel jbrockmendel merged commit bc6ad14 into pandas-dev:main Jul 14, 2025
47 checks passed
@jbrockmendel
Copy link
Member

thanks @petern48

@petern48 petern48 deleted the series_init branch July 17, 2025 03:36
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: Series.__init__ doc incorrectly says dtype is ignored if data is a Series
3 participants