Skip to content

Commit 7e53266

Browse files
committed
TST: unit test to close #2453
1 parent c03af9a commit 7e53266

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pandas/tests/test_frame.py

+22
Original file line numberDiff line numberDiff line change
@@ -7595,6 +7595,28 @@ def __nonzero__(self):
75957595
self.assert_(r0.all())
75967596
self.assert_(r1.all())
75977597

7598+
def test_strange_column_corruption_issue(self):
7599+
df = DataFrame(index=[0,1])
7600+
df[0] = nan
7601+
wasCol = {}
7602+
# uncommenting these makes the results match
7603+
#for col in xrange(100, 200):
7604+
# wasCol[col] = 1
7605+
# df[col] = nan
7606+
7607+
for i, dt in enumerate(df.index):
7608+
for col in xrange(100, 200):
7609+
if not col in wasCol:
7610+
wasCol[col] = 1
7611+
df[col] = nan
7612+
df[col][dt] = i
7613+
7614+
myid = 100
7615+
7616+
first = len(df.ix[isnull(df[myid]), [myid]])
7617+
second = len(df.ix[isnull(df[myid]), [myid]])
7618+
self.assertTrue(first == second == 0)
7619+
75987620

75997621
if __name__ == '__main__':
76007622
# unittest.main()

0 commit comments

Comments
 (0)