Skip to content

Commit 1a56449

Browse files
committed
DOC: Fix spacing and reword parameter info and examples (pandas-dev#41423).
Remove return, replace with has. Remove array, replace with list. Fix array spacing to match other Series examples. Replace long param info with only affects sentence, based off DataFrame documentation. Reword example explanation. Change numpy.array to 1d ndarray to match other documentation, like DataFrame.
1 parent 2ed2b8d commit 1a56449

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

pandas/core/series.py

+14-17
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,7 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
223223
name : str, optional
224224
The name to give to the Series.
225225
copy : bool, default False
226-
Copy input data. If False and the Series returns a `copy`
227-
of the data, the memory location for the values is not shared.
228-
If False and the Series returns a `view` on the data,
229-
the memory location for the values is shared.
226+
Copy input data. Only affects Series or 1d ndarray input. See examples.
230227
231228
Examples
232229
--------
@@ -255,9 +252,9 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
255252
After this the Series is reindexed with the given Index values, hence we
256253
get all NaN as a result.
257254
258-
Constructing Series from an array with `copy=False`.
259-
260-
>>> r = [1,2]
255+
Constructing Series from a list with `copy=False`.
256+
257+
>>> r = [1, 2]
261258
>>> ser = pd.Series(r, copy=False)
262259
>>> ser.iloc[0] = 999
263260
>>> r
@@ -266,13 +263,13 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
266263
0 999
267264
1 2
268265
dtype: int64
269-
270-
The Series returns a `copy` of the original data, so
271-
the original data is unchanged.
272-
273-
Constructing Series from a `numpy.array` with `copy=False`.
274-
275-
>>> r = np.array([1,2])
266+
267+
Due to input data type the Series has a `copy` of the original data even though `copy=False`, so
268+
the data is unchanged.
269+
270+
Constructing Series from a 1d ndarray with `copy=False`.
271+
272+
>>> r = np.array([1, 2])
276273
>>> ser = pd.Series(r, copy=False)
277274
>>> ser.iloc[0] = 999
278275
>>> r
@@ -281,9 +278,9 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
281278
0 999
282279
1 2
283280
dtype: int32
284-
285-
The Series returns a `view` on the original data, so
286-
the original data is changed as well.
281+
282+
Due to input data type the Series has a `view` on the original data, so
283+
the data is changed as well.
287284
"""
288285

289286
_typ = "series"

0 commit comments

Comments
 (0)