We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e0c3fe commit b941968Copy full SHA for b941968
pandas/tests/test_frame.py
@@ -3382,6 +3382,23 @@ def test_to_csv_from_csv(self):
3382
3383
os.remove(path)
3384
3385
+ def test_to_csv_from_csv_w_infs(self):
3386
+ path = '__tmp__'
3387
+
3388
+ # test roundtrip with inf, -inf, nan, as full columns and mix
3389
+ self.frame['E'] = np.inf
3390
+ self.frame['F'] = -np.inf
3391
+ self.frame['G'] = np.nan
3392
+ self.frame['H'] = self.frame.index.map(lambda x: [np.inf, np.nan][np.random.rand() < .5])
3393
3394
+ self.frame.to_csv(path)
3395
+ recons = DataFrame.from_csv(path)
3396
3397
+ assert_frame_equal(self.frame, recons)
3398
+ assert_frame_equal(np.isinf(self.frame), np.isinf(recons))
3399
3400
+ os.remove(path)
3401
3402
def test_to_csv_multiindex(self):
3403
path = '__tmp__'
3404
0 commit comments