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

Skip to content

Commit 14b3ec0

Browse files
committed
Avoid csv2rec warning in plotfile.
Unfortunately, csv2rec provides some automatic converters, so it can't be replaced entirely with np.genfromtxt or np.loadtxt.
1 parent f85ab1b commit 14b3ec0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/matplotlib/pyplot.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,8 +2411,11 @@ def plotfile(fname, cols=(0,), plotfuncs=None,
24112411

24122412
if plotfuncs is None:
24132413
plotfuncs = dict()
2414-
r = mlab.csv2rec(fname, comments=comments, skiprows=skiprows,
2415-
checkrows=checkrows, delimiter=delimiter, names=names)
2414+
from matplotlib.cbook import mplDeprecation
2415+
with warnings.catch_warnings():
2416+
warnings.simplefilter('ignore', mplDeprecation)
2417+
r = mlab.csv2rec(fname, comments=comments, skiprows=skiprows,
2418+
checkrows=checkrows, delimiter=delimiter, names=names)
24162419

24172420
def getname_val(identifier):
24182421
'return the name and column data for identifier'

0 commit comments

Comments
 (0)