Skip to content

Commit

Permalink
To access a value by position, use ser.iloc[pos]
Browse files Browse the repository at this point in the history
  • Loading branch information
quant12345 committed Oct 4, 2024
1 parent e27e90e commit 18e2f66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/test_feature_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def test_aggregate_region_with_negative_weights(simple_df, caplog):

# dropping negative weights works as expected
neg_weights_df = simple_df.copy()
neg_weights_df._data[18] = -6
neg_weights_df._data.iloc[18] = -6
exp = simple_df.filter(variable=v, region="World", year=2010)
assert_iamframe_equal(neg_weights_df.aggregate_region(v, weight=w), exp)

Expand All @@ -338,7 +338,7 @@ def test_aggregate_region_with_negative_weights(simple_df, caplog):

# *not* dropping negative weights works as expected
exp = simple_df.filter(variable=v, region="World")
exp._data[0] = -8
exp._data.iloc[0] = -8
assert_iamframe_equal(
neg_weights_df.aggregate_region(v, weight=w, drop_negative_weights=False), exp
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def test_load_meta_exclude(test_pd_df):
"""Initializing from xlsx where 'meta' has an exclude columns (pyam < 2.0)"""
obs = IamDataFrame(TEST_DATA_DIR / "exclude_meta_sheet.xlsx")
exp = IamDataFrame(test_pd_df)
exp.exclude[0] = True
exp.exclude.iloc[0] = True
assert_iamframe_equal(obs, exp)


Expand Down

0 comments on commit 18e2f66

Please sign in to comment.