File Utilities

fileUtils.readCsvFile(fileName, includeFirstColumnLabel=False)[source]

Will read data from a csv file that has column labels and returns two pieces of data, the csv data itself as a numpy array and a list of header names. By default the first column is not included to make it compatible with plotArray. the argument, includeFirstColumnLabel=True if the first column label is needed

Parameters:
  • fileName (string) – Name and path of the csv file

  • includeFirstColumnLabel (bool) – Set true if you want to include the first column

Examples

>>> data, header = te.fileUtils.readCsvFile ('mydata.txt')

The data variable can be plotted using te.plotArray(data, header)

Example csv file

time,S1,S2
0.0, 0.4, 0.5
0.1, 0.2, 0.8
etc