What to use instead of csv2rec

1.2k views Asked by At

According to the documentation matplotlib.mlab.csv2rec is deprecated, but the message doesn't indicate what we should move to instead. This is an extremely useful function that keeps my scripts short, I don't want to go rewrite all of this by hand. What should I replace this with?

https://matplotlib.org/api/mlab_api.html#matplotlib.mlab.csv2rec

1

There are 1 answers

0
Elliott Slaughter On

I've been able to get by with the following workaround:

import numpy as np
def csv2rec(filename):
    return np.recfromtxt(filename, dtype=None, delimiter=',', names=True, encoding='utf-8')