From e0f18c6d3aec4bfbbae585c76e4131514293ddc3 Mon Sep 17 00:00:00 2001 From: Uddeshya Singh Date: Mon, 2 Jul 2018 12:41:51 +0530 Subject: [PATCH 1/5] Adding name *kwargs --- pandas/core/tools/datetimes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 18802d98a347e..503f6b35f1c27 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -99,7 +99,7 @@ def _convert_and_box_cache(arg, cache_array, box, errors, name=None): result = Series(arg).map(cache_array) if box: if errors == 'ignore': - return Index(result) + return Index(result, name=name) else: return DatetimeIndex(result, name=name) return result.values @@ -136,7 +136,7 @@ def _return_parsed_timezone_results(result, timezones, box, tz): in zip(result, timezones)]) if box: from pandas import Index - return Index(tz_results) + return Index(tz_results, name=name) return tz_results @@ -341,7 +341,7 @@ def _convert_listlike(arg, box, format, name=None, tz=tz): if box: if errors == 'ignore': from pandas import Index - return Index(result) + return Index(result, name=name) return DatetimeIndex(result, tz=tz, name=name) return result From dcdb2411ab1eceb79a7014971eeabe0022ea9d8e Mon Sep 17 00:00:00 2001 From: Uddeshya Singh Date: Mon, 2 Jul 2018 13:57:34 +0530 Subject: [PATCH 2/5] Update datetimes.py --- pandas/core/tools/datetimes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 503f6b35f1c27..4ad583f156862 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -99,9 +99,9 @@ def _convert_and_box_cache(arg, cache_array, box, errors, name=None): result = Series(arg).map(cache_array) if box: if errors == 'ignore': - return Index(result, name=name) + return Index(result, **name) else: - return DatetimeIndex(result, name=name) + return DatetimeIndex(result, **name) return result.values From 42a207c13629e703800151c8eb277873c02da772 Mon Sep 17 00:00:00 2001 From: Uddeshya Singh Date: Mon, 2 Jul 2018 13:59:51 +0530 Subject: [PATCH 3/5] Update datetimes.py --- pandas/core/tools/datetimes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 4ad583f156862..9213e33b3c609 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -99,9 +99,9 @@ def _convert_and_box_cache(arg, cache_array, box, errors, name=None): result = Series(arg).map(cache_array) if box: if errors == 'ignore': - return Index(result, **name) + return Index(result, {name : name}) else: - return DatetimeIndex(result, **name) + return DatetimeIndex(result, {name : name}) return result.values From 4b5a09c6882932fc1959f8a98a314d1609c017ca Mon Sep 17 00:00:00 2001 From: Uddeshya Singh Date: Mon, 2 Jul 2018 14:03:01 +0530 Subject: [PATCH 4/5] Fixing PEP-8 issues --- pandas/core/tools/datetimes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 9213e33b3c609..a84eab9039499 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -99,9 +99,9 @@ def _convert_and_box_cache(arg, cache_array, box, errors, name=None): result = Series(arg).map(cache_array) if box: if errors == 'ignore': - return Index(result, {name : name}) + return Index(result, {name: name}) else: - return DatetimeIndex(result, {name : name}) + return DatetimeIndex(result, {name: name}) return result.values From 9be64bab23fdd0983ceece6e41fe14b5f599bf5d Mon Sep 17 00:00:00 2001 From: Uddeshya Singh Date: Mon, 2 Jul 2018 22:53:33 +0530 Subject: [PATCH 5/5] Fixing kwargs format --- pandas/core/tools/datetimes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index a84eab9039499..503f6b35f1c27 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -99,9 +99,9 @@ def _convert_and_box_cache(arg, cache_array, box, errors, name=None): result = Series(arg).map(cache_array) if box: if errors == 'ignore': - return Index(result, {name: name}) + return Index(result, name=name) else: - return DatetimeIndex(result, {name: name}) + return DatetimeIndex(result, name=name) return result.values