Skip to content

Commit dca602b

Browse files
taranarmomroeschke
andauthored
BUG: add note to docstring about dtype keyword when creating Series from abother Series (#59300)
* BUG: add note on creating Series from Series with dtype keyword When creating Series from another Series `dtype` keyword is ignored. See GH #59060. Add note to the docstring to underline this behaviour to Series and DataFrame constructors. * make backticks double Co-authored-by: Matthew Roeschke <[email protected]> --------- Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 845d1e2 commit dca602b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

pandas/core/frame.py

+1
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ class DataFrame(NDFrame, OpsMixin):
531531
will perform column selection instead.
532532
dtype : dtype, default None
533533
Data type to force. Only a single dtype is allowed. If None, infer.
534+
If ``data`` is DataFrame then is ignored.
534535
copy : bool or None, default None
535536
Copy data from inputs.
536537
For dict data, the default of None behaves like ``copy=True``. For DataFrame

pandas/core/series.py

+1
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ class Series(base.IndexOpsMixin, NDFrame): # type: ignore[misc]
256256
Data type for the output Series. If not specified, this will be
257257
inferred from `data`.
258258
See the :ref:`user guide <basics.dtypes>` for more usages.
259+
If ``data`` is Series then is ignored.
259260
name : Hashable, default None
260261
The name to give to the Series.
261262
copy : bool, default False

0 commit comments

Comments
 (0)