Skip to content

Commit

Permalink
Revert "replace deprecated pandas.DataFrame.ix[] by iloc[] (#12)" (
Browse files Browse the repository at this point in the history
…#15)

This reverts commit `d4af47de6f294cd3f4c4b9df9cd3d1c4223b902a`. See #14
  • Loading branch information
danielhuppmann authored Feb 15, 2018
1 parent d4af47d commit 892e5a7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ixmp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.iloc[i], idx_names),
jSet.addElement(to_jlist(key.ix[i], idx_names),
str(key['comment'][i]))
else:
for i in key.index:
jSet.addElement(to_jlist(key.iloc[i], idx_names))
jSet.addElement(to_jlist(key.ix[i], idx_names))
elif isinstance(key, list):
if isinstance(key[0], list):
for i in range(len(key)):
Expand Down Expand Up @@ -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.iloc[i], idx_names),
jPar.addElement(to_jlist(key.ix[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.iloc[i], idx_names),
jPar.addElement(to_jlist(key.ix[i], idx_names),
_jdouble(key['value'][i]),
str(key['unit'][i]))
elif isinstance(key, list) and isinstance(key[0], list):
Expand Down Expand Up @@ -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.iloc[i], idx_names))
jItem.removeElement(to_jlist(key.ix[i], idx_names))
else:
jItem.removeElement(str(key))

Expand Down

0 comments on commit 892e5a7

Please sign in to comment.