Skip to content

Commit bddf799

Browse files
committed
Switched from float('nan') to np.nan
1 parent eab8038 commit bddf799

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/tests/test_groupby.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -6568,15 +6568,15 @@ def test_group_shift_with_null_key(self):
65686568
# values in column `B`, and then group by [`A`, `B`]. This should
65696569
# force `-1` in `labels` array of `gr_.grouper.group_info` exactly
65706570
# at those places, where the group-by key is partilly missing.
6571-
df = pd.DataFrame([(i % 12, i % 3 if i % 3 else float("nan"), i)
6571+
df = pd.DataFrame([(i % 12, i % 3 if i % 3 else np.nan, i)
65726572
for i in range(n_rows)], dtype=float,
65736573
columns=["A", "B", "Z"], index=None)
65746574
gr_ = df.groupby(["A", "B"])
65756575

65766576
# Generate teh expected dataframe
6577-
expected = pd.DataFrame([(i % 12, i % 3 if i % 3 else float("nan"),
6577+
expected = pd.DataFrame([(i % 12, i % 3 if i % 3 else np.nan,
65786578
i + 12 if i % 3 and i < n_rows - 12
6579-
else float("nan"))
6579+
else np.nan)
65806580
for i in range(n_rows)], dtype=float,
65816581
columns=["A", "B", "Z"], index=None)
65826582
result = gr_.shift(-1)

0 commit comments

Comments
 (0)