From 66933b64588f024dc5d1835f36eb3e18f553e56b Mon Sep 17 00:00:00 2001 From: Thomas Dickson Date: Sat, 5 Sep 2020 14:11:47 +0100 Subject: [PATCH 1/2] #35406 BUG/DOC addition to series docs to describe dict behaviour precedence --- pandas/core/series.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 9d84ce4b9ab2e..b7b1c039bc614 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -164,9 +164,7 @@ class Series(base.IndexOpsMixin, generic.NDFrame): index : array-like or Index (1d) Values must be hashable and have the same length as `data`. Non-unique index values are allowed. Will default to - RangeIndex (0, 1, 2, ..., n) if not provided. If both a dict and index - sequence are used, the index will override the keys found in the - dict. + RangeIndex (0, 1, 2, ..., n) if not provided. If data is dict-like and index is None, then the values in the index are used to reindex the Series after it is created using the keys in the data. dtype : str, numpy.dtype, or ExtensionDtype, optional Data type for the output Series. If not specified, this will be inferred from `data`. From 8c2422b9c9e9babff77e7929736cb0cc69599338 Mon Sep 17 00:00:00 2001 From: Thomas Dickson Date: Sat, 5 Sep 2020 14:34:23 +0100 Subject: [PATCH 2/2] #35406 BUG/DOC addition to series docs to describe dict behaviour precedence - meet codeformatting criteria --- pandas/core/series.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index b7b1c039bc614..d8fdaa2a60252 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -164,7 +164,9 @@ class Series(base.IndexOpsMixin, generic.NDFrame): index : array-like or Index (1d) Values must be hashable and have the same length as `data`. Non-unique index values are allowed. Will default to - RangeIndex (0, 1, 2, ..., n) if not provided. If data is dict-like and index is None, then the values in the index are used to reindex the Series after it is created using the keys in the data. + RangeIndex (0, 1, 2, ..., n) if not provided. If data is dict-like + and index is None, then the values in the index are used to + reindex the Series after it is created using the keys in the data. dtype : str, numpy.dtype, or ExtensionDtype, optional Data type for the output Series. If not specified, this will be inferred from `data`.