Skip to content

Commit cd96916

Browse files
committed
rec2csv raises explicit error when recarray ndim not 1
svn path=/trunk/matplotlib/; revision=8021
1 parent d1cc3b0 commit cd96916

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/mlab.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,6 +2598,9 @@ def newfunc(val, mask, mval):
25982598
return func(val)
25992599
return newfunc
26002600

2601+
if r.ndim != 1:
2602+
raise ValueError('rec2csv only operates on 1 dimensional recarrays')
2603+
26012604
formatd = get_formatd(r, formatd)
26022605
funcs = []
26032606
for i, name in enumerate(r.dtype.names):

0 commit comments

Comments
 (0)