carputils
Doxygen code documentation for the python framework controlling openCARP
Public Member Functions | List of all members
carputils.carpio.csv.CSVFile Class Reference

Read from a csv file. More...

Inheritance diagram for carputils.carpio.csv.CSVFile:
carputils.carpio.filelike.FileLikeMixin

Public Member Functions

def __init__ (self, filename)
 
def close (self)
 Close the file. More...
 
def header (self)
 Read the file header. More...
 
def data (self)
 Read the file data as a numpy array. More...
 
- Public Member Functions inherited from carputils.carpio.filelike.FileLikeMixin
def __enter__ (self)
 
def __exit__ (self, exc_type, exc_val, exc_tb)
 

Detailed Description

Read from a csv file.

The file may be gzipped - the code automatically determines if this is the case from the file extension.

Constructor & Destructor Documentation

◆ __init__()

def carputils.carpio.csv.CSVFile.__init__ (   self,
  filename 
)
Parameters
filename(str) Path of the file to read.

Member Function Documentation

◆ close()

def carputils.carpio.csv.CSVFile.close (   self)

Close the file.

◆ data()

def carputils.carpio.csv.CSVFile.data (   self)

Read the file data as a numpy array.

Returns
data (numpy.ndarray) The file data contents.

◆ header()

def carputils.carpio.csv.CSVFile.header (   self)

Read the file header.

Returns
header The file header

The documentation for this class was generated from the following file: