File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1- # (C) British Crown Copyright 2013 - 2015 , Met Office
1+ # (C) British Crown Copyright 2013 - 2016 , Met Office
22#
33# This file is part of Iris.
44#
@@ -129,6 +129,15 @@ def _assert_shared(np_obj, pandas_obj):
129129 base = pandas_obj .base
130130 else :
131131 base = pandas_obj [0 ].base
132+
133+ # Prior to Pandas 0.17, when pandas_obj is a Series, pandas_obj.values
134+ # returns a view of the underlying array, and pandas_obj.base, which calls
135+ # pandas_obj.values.base, returns the underlying array. In 0.17 and 0.18
136+ # pandas_obj.values returns the underlying array, so base may be None even
137+ # if the array is shared.
138+ if base is None :
139+ base = pandas_obj .values
140+
132141 # Chase the stack of NumPy `base` references back to see if any of
133142 # them are our original array.
134143 while base is not None :
You can’t perform that action at this time.
0 commit comments