I have found this python model online which has example and I'm trying to use example but it's not working. Example and other related things can be found here: https://github.com/USEPA/IO-Model-Builder/blob/master/example/example.ipynb
I tried to run provided example line by line in Jupyter Notebook, but I got stuck when I got to Satellite tables.
When I run this chunk of code:
sat_i = iomb.make_sat_table('satellite_table.csv')
sat_c = sat_i.apply_market_shares(io_model.get_market_shares(), 'sector_meta_data.csv')
sat_c.to_csv('satellite_table_com.csv')
I got this error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_13756\2825653640.py in ?()
1 sat_i = iomb.make_sat_table('satellite_table.csv')
----> 2 sat_c = sat_i.apply_market_shares(io_model.get_market_shares(), 'sector_meta_data.csv')
3
4 #sat_c.to_csv('satellite_table_com.csv')
~\AppData\Local\Programs\Python\Python311\Lib\site-packages\iomb\sat.py in ?(self, market_shares sector_info_csv)
313 new_table.sectors.append(new_sector)
314 new_table.sector_idx[new_sector.key] = new_col
315 share_entries = {}
316 shares[new_col] = share_entries
--> 317 m_shares = market_shares.ix[:, commodity]
318 for industry_key in m_shares.index:
319 share = m_shares[industry_key]
320 if share == 0:
~\AppData\Local\Programs\Python\Python311\Lib\site-packages\pandas\core\generic.py in ?(self, name)
5985 and name not in self._accessors
5986 and self._info_axis._can_hold_identifiers_and_holds_name(name)
5987 ):
5988 return self[name]
-> 5989 return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'ix'
It refers to the model, I cannot understand why this doesn't work. Any ideas what I could do to make it word?
Thanks in advance!