@@ -2052,7 +2052,7 @@ def mapped_r2field(name):
20522052
20532053def csv2rec (fname , comments = '#' , skiprows = 0 , checkrows = 0 , delimiter = ',' ,
20542054 converterd = None , names = None , missing = '' , missingd = None ,
2055- use_mrecords = True ):
2055+ use_mrecords = False ):
20562056 """
20572057 Load data from comma/space/tab delimited file in *fname* into a
20582058 numpy record array and return the record array.
@@ -2560,7 +2560,7 @@ def format(item, just_pad_prec_spacer):
25602560
25612561
25622562def rec2csv (r , fname , delimiter = ',' , formatd = None , missing = '' ,
2563- missingd = None ):
2563+ missingd = None , withheader = True ):
25642564 """
25652565 Save the data from numpy recarray *r* into a
25662566 comma-/space-/tab-delimited file. The record array dtype names
@@ -2569,6 +2569,9 @@ def rec2csv(r, fname, delimiter=',', formatd=None, missing='',
25692569 *fname*: can be a filename or a file handle. Support for gzipped
25702570 files is automatic, if the filename ends in '.gz'
25712571
2572+ *withheader*: if withheader is False, do not write the attribute
2573+ names in the first row
2574+
25722575 .. seealso::
25732576
25742577 :func:`csv2rec`
@@ -2595,7 +2598,8 @@ def newfunc(val, mask, mval):
25952598 fh , opened = cbook .to_filehandle (fname , 'w' , return_opened = True )
25962599 writer = csv .writer (fh , delimiter = delimiter )
25972600 header = r .dtype .names
2598- writer .writerow (header )
2601+ if withheader :
2602+ writer .writerow (header )
25992603
26002604 # Our list of specials for missing values
26012605 mvals = []
0 commit comments