diff --git a/ixmp/core.py b/ixmp/core.py index e2e069588..abd4b2a8d 100644 --- a/ixmp/core.py +++ b/ixmp/core.py @@ -562,11 +562,11 @@ def add_set(self, name, key, comment=None): idx_names = self.idx_names(name) if "comment" in list(key): for i in key.index: - jSet.addElement(to_jlist(key.ix[i], idx_names), + jSet.addElement(to_jlist(key.iloc[i], idx_names), str(key['comment'][i])) else: for i in key.index: - jSet.addElement(to_jlist(key.ix[i], idx_names)) + jSet.addElement(to_jlist(key.iloc[i], idx_names)) elif isinstance(key, list): if isinstance(key[0], list): for i in range(len(key)): @@ -677,13 +677,13 @@ def add_par(self, name, key, val=None, unit=None, comment=None): idx_names = self.idx_names(name) if "comment" in list(key): for i in key.index: - jPar.addElement(to_jlist(key.ix[i], idx_names), + jPar.addElement(to_jlist(key.iloc[i], idx_names), _jdouble(key['value'][i]), str(key['unit'][i]), str(key['comment'][i])) else: for i in key.index: - jPar.addElement(to_jlist(key.ix[i], idx_names), + jPar.addElement(to_jlist(key.iloc[i], idx_names), _jdouble(key['value'][i]), str(key['unit'][i])) elif isinstance(key, list) and isinstance(key[0], list): @@ -1108,7 +1108,7 @@ def _removeElement(jItem, key): key = pd.DataFrame.from_dict(key, orient='columns', dtype=None) idx_names = to_pylist(jItem.getIdxNames()) for i in key.index: - jItem.removeElement(to_jlist(key.ix[i], idx_names)) + jItem.removeElement(to_jlist(key.iloc[i], idx_names)) else: jItem.removeElement(str(key))