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

FutureWarning: treating keys as positions is deprecated #233

Open
k-knosala opened this issue Oct 11, 2023 · 0 comments
Open

FutureWarning: treating keys as positions is deprecated #233

k-knosala opened this issue Oct 11, 2023 · 0 comments

Comments

@k-knosala
Copy link
Collaborator

When running household_with_advanced_hp_hws_hds_pv I get the following Warning:

hisim/components/weather.py:824: FutureWarning: Series.getitem treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use ser.iloc[pos]
pd_database[-1],

In weather.py

        lastday = pd.Series(
            pd_database[-1],
            index=[
                pd.to_datetime(
                    datetime.datetime(year, 12, 31, 22, 59), utc=True
                ).tz_convert(tz="Europe/Berlin")
            ],
        )

should be changed to

        lastday = pd.Series(
            pd_database.iloc[-1],
            index=[
                pd.to_datetime(
                    datetime.datetime(year, 12, 31, 22, 59), utc=True
                ).tz_convert(tz="Europe/Berlin")
            ],
        )
@k-knosala k-knosala changed the title FutureWarning: FutureWarning: treating keys as positions is deprecated Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants