npu.inout.csv_io

Classes

CsvIO()

class npu.inout.csv_io.CsvIO
Author:

Alberto M. Esmoris Pena

Class with util static methods for input/output operations related to CSV files.

static write_dicts(path, dictionaries, encoding='utf-8')

Write a CSV file to the given path considering the keys of the first dictionary in the list as the header row and the values for each dictionary in the list as the body rows. Note that all the dictionaries must have the same keys.

Parameters:
  • path (str) – Path where the CSV file will be written.

  • dictionaries (list of dict) – The dictionaries representing the CSV.

  • encoding (str) – The encoding to be used for the output text file.

Returns:

Nothing at all, but a CSV file is written to the given path.