Skip to content

Commit b94c576

Browse files
committed
Merge pull request #6603 from jseabold/fix-testing
ENH: Make sure makeMissing* works as expected.
2 parents 45009f0 + f3e4397 commit b94c576

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/util/testing.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -941,8 +941,8 @@ def _gen_unique_rand(rng, _extra_size):
941941
extra_size *= 1.05
942942
ind = _gen_unique_rand(random_state, extra_size)
943943

944-
j = np.floor(ind * 1. / nrows)
945-
i = (ind - j * nrows)
944+
j = np.floor(ind * 1. / nrows).astype(int)
945+
i = (ind - j * nrows).astype(int)
946946
return i.tolist(), j.tolist()
947947

948948

@@ -973,15 +973,15 @@ def makeMissingCustomDataframe(nrows, ncols, density=.9, random_state=None,
973973
r_idx_type=r_idx_type)
974974

975975
i, j = _create_missing_idx(nrows, ncols, density, random_state)
976-
df.iloc[i, j] = np.nan
976+
df.values[i, j] = np.nan
977977
return df
978978

979979

980980
def makeMissingDataframe(density=.9, random_state=None):
981981
df = makeDataFrame()
982982
i, j = _create_missing_idx(*df.shape, density=density,
983983
random_state=random_state)
984-
df.iloc[i, j] = np.nan
984+
df.values[i, j] = np.nan
985985
return df
986986

987987

0 commit comments

Comments
 (0)