lab_driver.csv_handler#

Module Contents#

Classes#

API#

class lab_driver.csv_handler.CsvHandler(path: str, file_name: str, delimiter: str = ';')[source]#

Initialization

Creating a class for handling CSV-files

Parameters:
  • path – String with path to the folder which has the CSV file

  • file_name – String with name of the CSV file

  • delimiter – String with delimiter symbol used in the CSV file

write_data_to_csv(data: numpy.ndarray, chapter_line: list, type_load=float) None[source]#

Writing data from numpy array into csv file

Parameters:
  • data – Numpy array with data content

  • chapter_line – List with line numbers of chapter data for each column

  • type_load – Type of saving and converting numpy content to csv

Returns:

None

read_data_from_csv(include_chapter_line: bool = False, start_line: int = 0, type_load=int) numpy.array[source]#

Reading data in numpy format from csv file

Parameters:
  • include_chapter_line – Boolean for including the chapter line

  • start_line – Number of rows to skip (exclude chapter line)

  • type_load – Type of loading and converting csv content to numpy array

Returns:

Numpy array with data content

read_chapter_from_csv(start_line: int = 0) list[source]#

Reading the chapter line in list format from csv file

Returns:

List with chapter lines