From f4f3309fb99453bcfffa8f0707674bc5713fa1c4 Mon Sep 17 00:00:00 2001 From: themrmax Date: Tue, 4 Oct 2016 16:51:08 +1100 Subject: [PATCH 1/6] remove unique and hashable from series doco --- pandas/core/series.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 1c6b13885dd01..dd6b7156f643b 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -117,7 +117,7 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, data : array-like, dict, or scalar value Contains data stored in Series index : array-like or Index (1d) - Values must be unique and hashable, same length as data. Index + Values must be same length as data. Index object (or other iterable of same length as data) Will default to RangeIndex(len(data)) if not provided. If both a dict and index sequence are used, the index will override the keys found in the From 375834952a94716f16de3f00d10b6cb1b874752d Mon Sep 17 00:00:00 2001 From: themrmax Date: Tue, 4 Oct 2016 16:52:50 +1100 Subject: [PATCH 2/6] fix line formatting --- pandas/core/series.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index dd6b7156f643b..2aa7b6ed7324d 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -102,11 +102,11 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, """ One-dimensional ndarray with axis labels (including time series). - Labels need not be unique but must be any hashable type. The object - supports both integer- and label-based indexing and provides a host of - methods for performing operations involving the index. Statistical - methods from ndarray have been overridden to automatically exclude - missing data (currently represented as NaN) + Labels need not be unique. The object supports both integer- and + label-based indexing and provides a host of methods for performing + operations involving the index. Statistical methods from ndarray have + been overridden to automatically exclude missing data (currently + represented as NaN) Operations between Series (+, -, /, *, **) align values based on their associated index values-- they need not be the same length. The result @@ -117,8 +117,7 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, data : array-like, dict, or scalar value Contains data stored in Series index : array-like or Index (1d) - Values must be same length as data. Index - object (or other iterable of same length as data) Will default to + Values must be same length as data. Will default to RangeIndex(len(data)) if not provided. If both a dict and index sequence are used, the index will override the keys found in the dict. From 69227b7d9edbbcad3129d47c369cd5435304e58a Mon Sep 17 00:00:00 2001 From: themrmax Date: Wed, 23 Nov 2016 13:46:11 +1100 Subject: [PATCH 3/6] put hashable back in --- pandas/core/series.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 2aa7b6ed7324d..97e57e1603e6c 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -102,11 +102,11 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, """ One-dimensional ndarray with axis labels (including time series). - Labels need not be unique. The object supports both integer- and - label-based indexing and provides a host of methods for performing - operations involving the index. Statistical methods from ndarray have - been overridden to automatically exclude missing data (currently - represented as NaN) + Labels need not be unique but must be a hashable type. The object supports + both integer- and label-based indexing and provides a host of methods for + performing operations involving the index. Statistical methods from ndarray + have been overridden to automatically exclude missing data (currently + represented as NaN). Operations between Series (+, -, /, *, **) align values based on their associated index values-- they need not be the same length. The result @@ -117,10 +117,9 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, data : array-like, dict, or scalar value Contains data stored in Series index : array-like or Index (1d) - Values must be same length as data. Will default to - RangeIndex(len(data)) if not provided. If both a dict and index - sequence are used, the index will override the keys found in the - dict. + Values must be hashable and the same length as data. Will default to + RangeIndex(len(data)) if not provided. If both a dict and index sequence are + used, the index will override the keys found in the dict. dtype : numpy.dtype or None If None, dtype will be inferred copy : boolean, default False From 6462ef5277cd99efda3898a5e1482da3e23d11dc Mon Sep 17 00:00:00 2001 From: themrmax Date: Thu, 24 Nov 2016 12:03:34 +1100 Subject: [PATCH 4/6] fix spacing --- pandas/core/series.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 97e57e1603e6c..ed6ee09f42d3b 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -117,9 +117,9 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, data : array-like, dict, or scalar value Contains data stored in Series index : array-like or Index (1d) - Values must be hashable and the same length as data. Will default to - RangeIndex(len(data)) if not provided. If both a dict and index sequence are - used, the index will override the keys found in the dict. + Values must be hashable and the same length as data. Will default to + RangeIndex(len(data)) if not provided. If both a dict and index sequence + are used, the index will override the keys found in the dict. dtype : numpy.dtype or None If None, dtype will be inferred copy : boolean, default False From 26d5d979606d07ac9e16f39697d08e91147dffa0 Mon Sep 17 00:00:00 2001 From: themrmax Date: Fri, 25 Nov 2016 14:48:47 +1100 Subject: [PATCH 5/6] fix linewidth again --- pandas/core/series.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index ed6ee09f42d3b..c8b755369649a 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -118,8 +118,8 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, Contains data stored in Series index : array-like or Index (1d) Values must be hashable and the same length as data. Will default to - RangeIndex(len(data)) if not provided. If both a dict and index sequence - are used, the index will override the keys found in the dict. + RangeIndex(len(data)) if not provided. If both a dict and index + sequence are used, the index will override the keys found in the dict. dtype : numpy.dtype or None If None, dtype will be inferred copy : boolean, default False From 523c8960b46b9fade35cb59e1698d45122a0ff2e Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Fri, 25 Nov 2016 11:02:46 +0100 Subject: [PATCH 6/6] add suggestion of other PR + limit line length --- pandas/core/series.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index c8b755369649a..8a98f5cdf7e21 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -102,11 +102,11 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, """ One-dimensional ndarray with axis labels (including time series). - Labels need not be unique but must be a hashable type. The object supports - both integer- and label-based indexing and provides a host of methods for - performing operations involving the index. Statistical methods from ndarray - have been overridden to automatically exclude missing data (currently - represented as NaN). + Labels need not be unique but must be a hashable type. The object + supports both integer- and label-based indexing and provides a host of + methods for performing operations involving the index. Statistical + methods from ndarray have been overridden to automatically exclude + missing data (currently represented as NaN). Operations between Series (+, -, /, *, **) align values based on their associated index values-- they need not be the same length. The result @@ -117,9 +117,11 @@ class Series(base.IndexOpsMixin, strings.StringAccessorMixin, data : array-like, dict, or scalar value Contains data stored in Series index : array-like or Index (1d) - Values must be hashable and the same length as data. Will default to + Values must be hashable and have the same length as `data`. + Non-unique index values are allowed. Will default to RangeIndex(len(data)) if not provided. If both a dict and index - sequence are used, the index will override the keys found in the dict. + sequence are used, the index will override the keys found in the + dict. dtype : numpy.dtype or None If None, dtype will be inferred copy : boolean, default False