Skip to content

TST: fixup 32-bit failing tests #3648

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
May 19, 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
4 changes: 1 addition & 3 deletions pandas/core/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,6 @@ def __init__(self, obj, path_or_buf, sep=",", na_rep='', float_format=None,
tupleize_cols=True):

self.engine = engine # remove for 0.12

obj._consolidate_inplace()
self.obj = obj

self.path_or_buf = path_or_buf
Expand Down Expand Up @@ -835,7 +833,7 @@ def __init__(self, obj, path_or_buf, sep=",", na_rep='', float_format=None,
self.blocks = self.obj._data.blocks
ncols = sum(len(b.items) for b in self.blocks)
self.data =[None] * ncols
self.column_map = self.obj._data.get_items_map()
self.column_map = self.obj._data.get_items_map(use_cached=False)

if chunksize is None:
chunksize = (100000/ (len(self.cols) or 1)) or 1
Expand Down
13 changes: 8 additions & 5 deletions pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,17 +1130,20 @@ def maybe_create_block(block):
# when we recreate the block manager if needed
return getattr(self,'_ref_locs',None)

def get_items_map(self):
def get_items_map(self, use_cached=True):
"""
return an inverted ref_loc map for an item index
block -> item (in that block) location -> column location

use_cached : boolean, use the cached items map, or recreate
"""

# cache check
im = getattr(self,'_items_map',None)
if im is not None:
return im

if use_cached:
im = getattr(self,'_items_map',None)
if im is not None:
return im

im = dict()
rl = self._set_ref_locs()

Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4942,7 +4942,7 @@ def test_to_csv_no_index(self):
df.to_csv(path, index=False)
result = read_csv(path)
assert_frame_equal(df,result)
df['c3'] = [7,8,9]
df['c3'] = Series([7,8,9],dtype='int64')
df.to_csv(path, index=False)
result = read_csv(path)
assert_frame_equal(df,result)
Expand Down Expand Up @@ -5000,7 +5000,8 @@ def _make_frame(names=None):
columns=MultiIndex.from_tuples([('bah', 'foo'),
('bah', 'bar'),
('ban', 'baz')],
names=names))
names=names),
dtype='int64')

# column & index are multi-index
df = mkdf(5,3,r_idx_nlevels=2,c_idx_nlevels=4)
Expand Down