Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To access a value by position, use ser.iloc[pos] #880

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Next release

- [#880](https://github.com/IAMconsortium/pyam/pull/880) Use `pd.Series.iloc[pos]` for forward-compatibility
- [#877](https://github.com/IAMconsortium/pyam/pull/xxx) Support `engine` and other `pd.ExcelFile` keywords.

# Release v2.2.4
Expand Down
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
Loading