We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8b44dd commit 995ca49Copy full SHA for 995ca49
pandas/tests/indexing/test_loc.py
@@ -894,6 +894,22 @@ def test_identity_slice_returns_new_object(self):
894
original_series[:3] = [7, 8, 9]
895
assert all(sliced_series[:3] == [7, 8, 9])
896
897
+ def test_loc_copy_vs_view(self):
898
+ # GH 15631
899
+ x = DataFrame(zip(range(3), range(3)), columns=["a", "b"])
900
+
901
+ y = x.copy()
902
+ q = y.loc[:, "a"]
903
+ q += 2
904
905
+ tm.assert_frame_equal(x, y)
906
907
+ z = x.copy()
908
+ q = z.loc[x.index, "a"]
909
910
911
+ tm.assert_frame_equal(x, z)
912
913
def test_loc_uint64(self):
914
# GH20722
915
# Test whether loc accept uint64 max value as index.
0 commit comments