There was an error while loading. Please reload this page.
1 parent 83884d6 commit 63d8502Copy full SHA for 63d8502
1 file changed
psyplot/data.py
@@ -2147,8 +2147,13 @@ def base(self):
2147
if self._base is None:
2148
if 'variable' in self.arr.dims:
2149
def to_dataset(i):
2150
- return self.isel(variable=i).drop('variable').to_dataset(
+ ret = self.isel(variable=i).to_dataset(
2151
name=self.arr.coords['variable'].values[i])
2152
+ try:
2153
+ return ret.drop('variable')
2154
+ except ValueError: # 'variable' Variable not defined
2155
+ pass
2156
+ return ret
2157
ds = to_dataset(0)
2158
if len(self.arr.coords['variable']) > 1:
2159
for i in range(1, len(self.arr.coords['variable'])):
0 commit comments