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

MAINT: change in pandas.Dataframe.loc #738

Closed
jklenzing opened this issue Mar 16, 2021 · 2 comments · Fixed by #750
Closed

MAINT: change in pandas.Dataframe.loc #738

jklenzing opened this issue Mar 16, 2021 · 2 comments · Fixed by #750
Assignees
Milestone

Comments

@jklenzing
Copy link
Member

FutureWarning: Slicing a positional slice with .loc is not supported, and will raise TypeError in a future version.  Use .loc with labels or .iloc with positions instead.

Deprecated as of pandas 1.1.0, will be removed in pandas 2.0.0 (target Oct 1, 2021)

Line affected:

self.data.loc[key[0], key[1]] = new

Unit Tests affected:

pysat/tests/test_instrument.py::TestBasics::test_setting_partial_data_by_inputs[changed2-fixed2]
pysat/tests/test_instrument.py::TestBasics2D::test_setting_partial_data_by_inputs[changed2-fixed2]
pysat/tests/test_instrument.py::TestBasicsShiftedFileDates::test_setting_partial_data_by_inputs[changed2-fixed2]
@jklenzing jklenzing changed the title FW: change in pandas.Dataframe.loc MAINT: change in pandas.Dataframe.loc Mar 16, 2021
@jklenzing jklenzing added this to the 3.0.0 Release milestone Mar 26, 2021
@jklenzing jklenzing self-assigned this Mar 26, 2021
@jklenzing
Copy link
Member Author

jklenzing commented Mar 26, 2021

Update: this specifically affects cases where:

inst[slice(0, 10), 'doubleMLT'] = 0

which corresponds to the 'changed2-fixed2' conditions in the tests above.

The TypeError that is thrown will handle this correctly by passing the slice through to the index directly, which is the correct way of handling the future operations. Will update the comments around this to close this issue.

@jklenzing jklenzing linked a pull request Mar 26, 2021 that will close this issue
10 tasks
@jklenzing
Copy link
Member Author

Closing with merge of #750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant