Skip to content
Merged
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
80 changes: 25 additions & 55 deletions pandas/tests/frame/test_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,63 +358,33 @@ def _to_uni(x):

N = 100
chunksize = 1000

for ncols in [4]:
base = int((chunksize // ncols or 1) or 1)
for nrows in [
2,
10,
N - 1,
N,
N + 1,
N + 2,
2 * N - 2,
2 * N - 1,
2 * N,
2 * N + 1,
2 * N + 2,
base - 1,
base,
base + 1,
]:
_do_test(
tm.makeCustomDataframe(
nrows, ncols, r_idx_type="dt", c_idx_type="s"
),
"dt",
"s",
)

for ncols in [4]:
base = int((chunksize // ncols or 1) or 1)
for nrows in [
2,
10,
N - 1,
N,
N + 1,
N + 2,
2 * N - 2,
2 * N - 1,
2 * N,
2 * N + 1,
2 * N + 2,
base - 1,
base,
base + 1,
]:
_do_test(
tm.makeCustomDataframe(
nrows, ncols, r_idx_type="dt", c_idx_type="s"
),
"dt",
"s",
)
pass
ncols = 4
base = chunksize // ncols
for nrows in [
2,
10,
N - 1,
N,
N + 1,
N + 2,
2 * N - 2,
2 * N - 1,
2 * N,
2 * N + 1,
2 * N + 2,
base - 1,
base,
base + 1,
]:
_do_test(
tm.makeCustomDataframe(nrows, ncols, r_idx_type="dt", c_idx_type="s"),
"dt",
"s",
)

for r_idx_type, c_idx_type in [("i", "i"), ("s", "s"), ("u", "dt"), ("p", "p")]:
for ncols in [1, 2, 3, 4]:
base = int((chunksize // ncols or 1) or 1)
base = chunksize // ncols
for nrows in [
2,
10,
Expand All @@ -440,7 +410,7 @@ def _to_uni(x):
)

for ncols in [1, 2, 3, 4]:
base = int((chunksize // ncols or 1) or 1)
base = chunksize // ncols
for nrows in [
10,
N - 2,
Expand Down