python - Error in matplotlib csv2rec function -


i using csv2rec read csv file. many fields in csv file named "ms1-api2_c". when field read csv2rec, field name being converted "ms1api2_c". can not access column elements using converted field name or original field name. please suggest solutions.

csv2rec designed automatically lowercase headers, can around feature using following approach:

import matplotlib.mlab import csv  filename = 'input.csv'  open(filename, 'r') f_input:     headers = next(csv.reader(f_input))  data = matplotlib.mlab.csv2rec(filename, names=headers) 

to quote matplotlib documentation:

the headers lower cased, spaces converted underscores, , illegal attribute name characters removed.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -