Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 89635df

Browse files
committed
some tweaks to csv2rec and rec2csv
svn path=/trunk/matplotlib/; revision=7239
1 parent c144376 commit 89635df

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2009-06-24 Add withheader option to mlab.rec2csv and changed
2+
use_mrecords default to False in mlab.csv2rec since this is
3+
partially broken - JDH
4+
5+
16
2009-06-24 backend_agg.draw_marker quantizes the main path (as in the
27
draw_path). - JJL
38

doc/api/api_changes.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
===========
23
API Changes
34
===========
@@ -20,7 +21,10 @@ list may help describe what changes may be necessary in your code.
2021
Changes beyond 0.98.x
2122
=====================
2223

23-
* Axes instanaces no longer have a "frame" attribute. Instead, use the
24+
* changed use_mrecords default to False in mlab.csv2rec since this is
25+
partially broken
26+
27+
* Axes instances no longer have a "frame" attribute. Instead, use the
2428
new "spines" attribute. Spines is a dictionary where the keys are
2529
the names of the spines (e.g. 'left','right' and so on) and the
2630
values are the artists that draw the spines. For normal

doc/devel/release_guide.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,17 @@ Packaging
6464
or off any platform specific build options you need. Importantly,
6565
you also need to make sure that you delete the :file:`build` dir
6666
after any changes to file:`setup.cfg` before rebuilding since cruft
67-
in the :file:`build` dir can get carried along. I will add this to
68-
the devel release notes,
67+
in the :file:`build` dir can get carried along.
6968

7069
* on windows, unix2dos the rc file
7170

7271
* We have a Makefile for the OS X builds in the mpl source dir
7372
:file:`release/osx`, so use this to prepare the OS X releases.
7473

75-
74+
* We have a Makefile for the win32 mingw builds in the mpl source dir
75+
:file:`release/win32` which you can use this to prepare the windows
76+
releases, but this is currently broken for python2.6 as described at
77+
http://www.nabble.com/binary-installers-for-python2.6--libpng-segfault%2C-MSVCR90.DLL-and-%09mingw-td23971661.html
7678

7779
.. _release-candidate-testing:
7880

lib/matplotlib/mlab.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,7 @@ def mapped_r2field(name):
20522052

20532053
def 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

25622562
def 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

Comments
 (0)