@@ -267,8 +267,8 @@ def _do_test(df, r_dtype=None, c_dtype=None,
267
267
268
268
with ensure_clean ('__tmp_to_csv_moar__' ) as path :
269
269
df .to_csv (path , encoding = 'utf8' ,
270
- chunksize = chunksize , tupleize_cols = False )
271
- recons = self .read_csv (path , tupleize_cols = False , ** kwargs )
270
+ chunksize = chunksize )
271
+ recons = self .read_csv (path , ** kwargs )
272
272
else :
273
273
kwargs ['header' ] = 0
274
274
@@ -542,35 +542,35 @@ def _make_frame(names=None):
542
542
543
543
# column & index are multi-index
544
544
df = mkdf (5 , 3 , r_idx_nlevels = 2 , c_idx_nlevels = 4 )
545
- df .to_csv (path , tupleize_cols = False )
546
- result = read_csv (path , header = [0 , 1 , 2 , 3 ], index_col = [
547
- 0 , 1 ], tupleize_cols = False )
545
+ df .to_csv (path )
546
+ result = read_csv (path , header = [0 , 1 , 2 , 3 ],
547
+ index_col = [ 0 , 1 ])
548
548
assert_frame_equal (df , result )
549
549
550
550
# column is mi
551
551
df = mkdf (5 , 3 , r_idx_nlevels = 1 , c_idx_nlevels = 4 )
552
- df .to_csv (path , tupleize_cols = False )
552
+ df .to_csv (path )
553
553
result = read_csv (
554
- path , header = [0 , 1 , 2 , 3 ], index_col = 0 , tupleize_cols = False )
554
+ path , header = [0 , 1 , 2 , 3 ], index_col = 0 )
555
555
assert_frame_equal (df , result )
556
556
557
557
# dup column names?
558
558
df = mkdf (5 , 3 , r_idx_nlevels = 3 , c_idx_nlevels = 4 )
559
- df .to_csv (path , tupleize_cols = False )
560
- result = read_csv (path , header = [0 , 1 , 2 , 3 ], index_col = [
561
- 0 , 1 , 2 ], tupleize_cols = False )
559
+ df .to_csv (path )
560
+ result = read_csv (path , header = [0 , 1 , 2 , 3 ],
561
+ index_col = [ 0 , 1 , 2 ])
562
562
assert_frame_equal (df , result )
563
563
564
564
# writing with no index
565
565
df = _make_frame ()
566
- df .to_csv (path , tupleize_cols = False , index = False )
567
- result = read_csv (path , header = [0 , 1 ], tupleize_cols = False )
566
+ df .to_csv (path , index = False )
567
+ result = read_csv (path , header = [0 , 1 ])
568
568
assert_frame_equal (df , result )
569
569
570
570
# we lose the names here
571
571
df = _make_frame (True )
572
- df .to_csv (path , tupleize_cols = False , index = False )
573
- result = read_csv (path , header = [0 , 1 ], tupleize_cols = False )
572
+ df .to_csv (path , index = False )
573
+ result = read_csv (path , header = [0 , 1 ])
574
574
assert _all_none (* result .columns .names )
575
575
result .columns .names = df .columns .names
576
576
assert_frame_equal (df , result )
@@ -589,15 +589,15 @@ def _make_frame(names=None):
589
589
590
590
# whatsnew example
591
591
df = _make_frame ()
592
- df .to_csv (path , tupleize_cols = False )
593
- result = read_csv (path , header = [0 , 1 ], index_col = [
594
- 0 ], tupleize_cols = False )
592
+ df .to_csv (path )
593
+ result = read_csv (path , header = [0 , 1 ],
594
+ index_col = [ 0 ] )
595
595
assert_frame_equal (df , result )
596
596
597
597
df = _make_frame (True )
598
- df .to_csv (path , tupleize_cols = False )
599
- result = read_csv (path , header = [0 , 1 ], index_col = [
600
- 0 ], tupleize_cols = False )
598
+ df .to_csv (path )
599
+ result = read_csv (path , header = [0 , 1 ],
600
+ index_col = [ 0 ] )
601
601
assert_frame_equal (df , result )
602
602
603
603
# column & index are multi-index (compatibility)
@@ -613,18 +613,17 @@ def _make_frame(names=None):
613
613
614
614
# invalid options
615
615
df = _make_frame (True )
616
- df .to_csv (path , tupleize_cols = False )
616
+ df .to_csv (path )
617
617
618
618
for i in [6 , 7 ]:
619
619
msg = 'len of {i}, but only 5 lines in file' .format (i = i )
620
620
with tm .assert_raises_regex (ParserError , msg ):
621
- read_csv (path , tupleize_cols = False ,
622
- header = lrange (i ), index_col = 0 )
621
+ read_csv (path , header = lrange (i ), index_col = 0 )
623
622
624
623
# write with cols
625
624
with tm .assert_raises_regex (TypeError , 'cannot specify cols '
626
625
'with a MultiIndex' ):
627
- df .to_csv (path , tupleize_cols = False , columns = ['foo' , 'bar' ])
626
+ df .to_csv (path , columns = ['foo' , 'bar' ])
628
627
629
628
with ensure_clean ('__tmp_to_csv_multiindex__' ) as path :
630
629
# empty
0 commit comments