We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6253fff commit aaa8c04Copy full SHA for aaa8c04
lib/iris/pandas.py
@@ -130,8 +130,14 @@ def _assert_shared(np_obj, pandas_obj):
130
else:
131
base = pandas_obj[0].base
132
133
- if pandas_obj.values is np_obj:
134
- return
+ # Prior to Pandas 0.17, when pandas_obj is a Series, pandas_obj.values
+ # 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
+
141
# Chase the stack of NumPy `base` references back to see if any of
142
# them are our original array.
143
while base is not None:
0 commit comments