From 11a32173d12c2d1e0b5faf85ea19f45c7d7f925b Mon Sep 17 00:00:00 2001 From: Cameron Stark Date: Wed, 23 Oct 2019 09:39:17 -0600 Subject: [PATCH 1/2] replace Pandas item() implementation with numpy's using .values --- pvlib/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tools.py b/pvlib/tools.py index cbd59a8541..25f42cc972 100644 --- a/pvlib/tools.py +++ b/pvlib/tools.py @@ -212,7 +212,7 @@ def _scalar_out(input): else: # # works if it's a 1 length array and # will throw a ValueError otherwise - output = input.item() + output = input.values.item() return output From 7452e0e638a267d71084163f36839781abe97d3e Mon Sep 17 00:00:00 2001 From: Cameron Stark Date: Wed, 23 Oct 2019 14:51:07 -0600 Subject: [PATCH 2/2] force value to np.ndarray to enable universal use of .item() --- pvlib/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/tools.py b/pvlib/tools.py index 25f42cc972..dfeb8173f2 100644 --- a/pvlib/tools.py +++ b/pvlib/tools.py @@ -212,7 +212,7 @@ def _scalar_out(input): else: # # works if it's a 1 length array and # will throw a ValueError otherwise - output = input.values.item() + output = np.asarray(input).item() return output