Skip to content

DEPR: making copies when indexing along columns #36105

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

Closed
wants to merge 20 commits into from
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4c5eddd
REF: remove unnecesary try/except
jbrockmendel Aug 21, 2020
c632c9f
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Aug 21, 2020
9e64be3
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Aug 21, 2020
42649fb
TST: add test for agg on ordered categorical cols (#35630)
mathurk1 Aug 21, 2020
47121dd
TST: resample does not yield empty groups (#10603) (#35799)
tkmz-n Aug 21, 2020
1decb3e
revert accidental rebase
jbrockmendel Aug 22, 2020
57c5dd3
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 22, 2020
a358463
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 23, 2020
ffa7ad7
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 23, 2020
e5e98d4
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 24, 2020
408db5a
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 24, 2020
d3493cf
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 25, 2020
75a805a
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 25, 2020
9f61070
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 25, 2020
2d10f6e
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 26, 2020
3e20187
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 26, 2020
e27d07f
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 27, 2020
c52bed4
Merge branch 'master' of https://github.com/pandas-dev/pandas into ma…
jbrockmendel Aug 27, 2020
46f924a
DEPR: deprecate making copies when indexing on columns
jbrockmendel Sep 4, 2020
f790572
Merge branch 'master' of https://github.com/pandas-dev/pandas into de…
jbrockmendel Sep 4, 2020
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
14 changes: 14 additions & 0 deletions pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,13 @@ def _slice_take_blocks_ax0(
]
return blocks
else:
warnings.warn(
"In a future version, indexing along columns will "
"always return a view, never a copy. "
"To restore the previous behavior, use result.copy() "
"instead of result",
FutureWarning,
)
return [
blk.take_nd(
slobj,
Expand Down Expand Up @@ -1390,6 +1397,13 @@ def _slice_take_blocks_ax0(
nb = blk.getitem_block([i], new_mgr_locs=ml)
blocks.append(nb)
else:
warnings.warn(
"In a future version, indexing along columns will "
"always return a view, never a copy. "
"To restore the previous behavior, use result.copy() "
"instead of result",
FutureWarning,
)
nb = blk.take_nd(taker, axis=0, new_mgr_locs=mgr_locs)
blocks.append(nb)

Expand Down