@@ -223,9 +223,10 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
223
223
name : str, optional
224
224
The name to give to the Series.
225
225
copy : bool, default False
226
- Copy input data. If False and the Series returns a `view` of the data,
227
- the memory location for the values is shared. If False and the Series returns a `copy`
226
+ Copy input data. If False and the Series returns a `copy`
228
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.
229
230
230
231
Examples
231
232
--------
@@ -253,6 +254,34 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
253
254
Note that the Index is first build with the keys from the dictionary.
254
255
After this the Series is reindexed with the given Index values, hence we
255
256
get all NaN as a result.
257
+
258
+ Constructing Series from an array with `copy=False`.
259
+ >>> r = [1,2]
260
+ >>> ser = pd.Series(r, copy=False)
261
+ >>> ser.iloc[0] = 999
262
+ >>> r
263
+ [1, 2]
264
+ >>> ser
265
+ 0 999
266
+ 1 2
267
+ dtype: int64
268
+
269
+ The Series returns a `copy` of the original data, so
270
+ `r` is unchanged.
271
+
272
+ Constructing Series from a `numpy.array` with `copy=False`.
273
+ >>> r = np.array([1,2])
274
+ >>> ser = pd.Series(r, copy=False)
275
+ >>> ser.iloc[0] = 999
276
+ >>> r
277
+ array([999, 2])
278
+ >>> ser
279
+ 0 999
280
+ 1 2
281
+ dtype: int32
282
+
283
+ The Series returns a `view` on the original data, so
284
+ `r` is changed as well.
256
285
"""
257
286
258
287
_typ = "series"
0 commit comments