Closed nesnoj closed 4 years ago
Creating jupy nb via papermill I get (current dev) for several scenarios:
02:11:49-WARNING: Scenario NEP2035: An exception of type PapermillExecutionError occurred: 02:11:49-WARNING: --------------------------------------------------------------------------- Exception encountered at "In [23]": --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-23-febc06126880> in <module> ----> 1 df_data = results_scns[scenario]['flows_txaxt']['Line loading'].max(level=1).unstack() * 100 2 df_data = df_data.sort_index(ascending=False) 3 df_data = pd.DataFrame().from_dict({'line loading': df_data,'free capacity': 100-df_data}) 4 5 index = [re.split(r'(\d+)', s) for s in df_data.index] ~/virtualenvs/windnode_abw/lib/python3.8/site-packages/pandas/core/series.py in unstack(self, level, fill_value) 3548 from pandas.core.reshape.reshape import unstack 3549 -> 3550 return unstack(self, level, fill_value) 3551 3552 # ---------------------------------------------------------------------- ~/virtualenvs/windnode_abw/lib/python3.8/site-packages/pandas/core/reshape/reshape.py in unstack(obj, level, fill_value) 412 if is_extension_array_dtype(obj.dtype): 413 return _unstack_extension_series(obj, level, fill_value) --> 414 unstacker = _Unstacker( 415 obj.values, 416 obj.index, ~/virtualenvs/windnode_abw/lib/python3.8/site-packages/pandas/core/reshape/reshape.py in __init__(self, values, index, level, value_columns, fill_value, constructor) 111 raise ValueError("must pass column labels for multi-column data") 112 --> 113 self.index = index.remove_unused_levels() 114 115 self.level = self.index._get_level_number(level) AttributeError: 'Index' object has no attribute 'remove_unused_levels' 02:11:49-WARNING: Scenario NEP2035 skipped...
Ups. Its propably the .unstack() taht shouldnt be there
Creating jupy nb via papermill I get (current dev) for several scenarios: