Skip to content

BUG/TST: test fixes for windows compat #4123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2013
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
5 changes: 4 additions & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2206,7 +2206,10 @@ def _sanitize_column(self, key, value):
'length of index')

if not isinstance(value, np.ndarray):
value = com._asarray_tuplesafe(value)
if isinstance(value, list) and len(value) > 0:
value = com._possibly_convert_platform(value)
else:
value = com._asarray_tuplesafe(value)
elif isinstance(value, PeriodIndex):
value = value.asobject
elif value.ndim == 2:
Expand Down
14 changes: 8 additions & 6 deletions pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4891,14 +4891,17 @@ def make_dtnat_arr(n,nnat=None):
s[-i] = NaT
s[i] = NaT
return s

# N=35000
s1=make_dtnat_arr(chunksize+5)
s2=make_dtnat_arr(chunksize+5,0)

# s3=make_dtnat_arr(chunksize+5,0)
df=DataFrame(dict(a=s1,b=s2))
df.to_csv('/tmp/1.csv',chunksize=chunksize)
recons = DataFrame.from_csv('/tmp/1.csv').convert_objects('coerce')
assert_frame_equal(df, recons,check_names=False,check_less_precise=True)
with ensure_clean('1.csv') as path:
df=DataFrame(dict(a=s1,b=s2))
df.to_csv(path,chunksize=chunksize)
recons = DataFrame.from_csv(path).convert_objects('coerce')
assert_frame_equal(df, recons,check_names=False,check_less_precise=True)

for ncols in [4]:
base = int((chunksize// ncols or 1) or 1)
Expand Down Expand Up @@ -6864,7 +6867,7 @@ def test_replace_convert(self):
df = DataFrame([['foo', 'bar', 'bah'], ['bar', 'foo', 'bah']])
m = {'foo': 1, 'bar': 2, 'bah': 3}
rep = df.replace(m)
expec = Series([np.int_, np.int_, np.int_])
expec = Series([ np.int64] * 3)
res = rep.dtypes
assert_series_equal(expec, res)

Expand Down Expand Up @@ -10079,7 +10082,6 @@ def test_insert_column_bug_4032(self):

result = df.rename(columns={})
str(result)

expected = DataFrame([[1,1.1],[2, 2.2]],columns=['a','b'])
assert_frame_equal(result,expected)
df.insert(0, 'c', [1.3, 2.3])
Expand Down