Skip to content
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
2 changes: 1 addition & 1 deletion pandas/tests/frame/methods/test_combine_first.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_combine_first(self, float_frame):
assert (combined["A"][:10] == 1).all()

# reverse overlap
tail["A"][:10] = 0
tail.iloc[:10, tail.columns.get_loc("A")] = 0
combined = tail.combine_first(head)
assert (combined["A"][:10] == 0).all()

Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/frame/methods/test_cov_corr.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def test_cov(self, float_frame, float_string_frame):

# with NAs
frame = float_frame.copy()
frame["A"][:5] = np.nan
frame["B"][5:10] = np.nan
frame.iloc[:5, frame.columns.get_loc("A")] = np.nan
frame.iloc[5:10, frame.columns.get_loc("B")] = np.nan
result = frame.cov(min_periods=len(frame) - 8)
expected = frame.cov()
expected.loc["A", "B"] = np.nan
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/frame/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,8 @@ def test_combineFrame(self, float_frame, mixed_float_frame, mixed_int_frame):
frame_copy = float_frame.reindex(float_frame.index[::2])

del frame_copy["D"]
frame_copy["C"][:5] = np.nan
# adding NAs to first 5 values of column "C"
frame_copy.loc[: frame_copy.index[4], "C"] = np.nan

added = float_frame + frame_copy

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/groupby/test_apply_mutate.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_apply_function_with_indexing():
)

def fn(x):
x.col2[x.index[-1]] = 0
x.loc[x.index[-1], "col2"] = 0
return x.col2

result = df.groupby(["col1"], as_index=False).apply(fn)
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/indexing/multiindex/test_partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ def test_partial_set(self, multiindex_year_month_day_dataframe_random_data):
df = ymd.copy()
exp = ymd.copy()
df.loc[2000, 4] = 0
exp.loc[2000, 4].values[:] = 0
exp.iloc[65:85] = 0
tm.assert_frame_equal(df, exp)

df["A"].loc[2000, 4] = 1
exp["A"].loc[2000, 4].values[:] = 1
tm.assert_frame_equal(df, exp)

df.loc[2000] = 5
exp.loc[2000].values[:] = 5
exp.iloc[:100] = 5
tm.assert_frame_equal(df, exp)

# this works...for now
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexing/test_loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
def test_not_change_nan_loc(series, new_series, expected_ser):
# GH 28403
df = DataFrame({"A": series})
df["A"].loc[:] = new_series
df.loc[:, "A"] = new_series
expected = DataFrame({"A": expected_ser})
tm.assert_frame_equal(df.isna(), expected)
tm.assert_frame_equal(df.notna(), ~expected)
Expand Down