Search Results for

    Show / Hide Table of Contents

    Class CSV

    IO Utility class for loading time-series data from a plain text comma-separated variable(CSV) file

    Inheritance
    object
    CSV
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: TimeSeriesAnalysis.Utility
    Assembly: TimeSeriesAnalysis.dll
    Syntax
    public class CSV

    Methods

    | Edit this page View Source

    LoadDataFromCSV(string, char, out double[,], out string[], out string[,])

    Load time-series data from a CSV-file, low-level version for further processing

    Declaration
    public static bool LoadDataFromCSV(string filename, char separator, out double[,] doubleData, out string[] variableNames, out string[,] stringData)
    Parameters
    Type Name Description
    string filename

    path of file to be loaded

    char separator

    separator character used to separate data in file

    double[,] doubleData

    (output) the returned 2D array where each column is the data for one variable(NaNs if not able to parse as number)

    string[] variableNames

    (output) an array of the variable names in doubleData

    string[,] stringData

    (output)the raw data of the entire csv-file in a 2D array, only needed if parsing of other two variables has failed, and useful for retireving timestamps

    Returns
    Type Description
    bool
    | Edit this page View Source

    LoadDataFromCSV(string, out double[,], out string[], out string[,])

    Load time-series data from a CSV-file into variables for further processing (using the default ";" separator)

    Declaration
    public static bool LoadDataFromCSV(string filename, out double[,] doubleData, out string[] variableNames, out string[,] stringData)
    Parameters
    Type Name Description
    string filename

    path of file to be loaded

    double[,] doubleData

    (output) the returned 2D array where each column is the data for one variable

    string[] variableNames

    (output) an array of the variable names in doubleData

    string[,] stringData

    (output)the raw data of the entire csv-file in a 2D array, only needed if parsing of other two variables has failed, and useful for retireving timestamps

    Returns
    Type Description
    bool
    | Edit this page View Source

    LoadDataFromCsvAsTimeSeries(string, char, out DateTime[], out Dictionary<string, double[]>, string)

    Loads data from a CSV-file, including parsing the times(first column)

    Declaration
    public static bool LoadDataFromCsvAsTimeSeries(string filename, char separator, out DateTime[] dateTimes, out Dictionary<string, double[]> variables, string dateTimeFormat = "yyyy-MM-dd HH:mm:ss")
    Parameters
    Type Name Description
    string filename
    char separator
    DateTime[] dateTimes
    Dictionary<string, double[]> variables
    string dateTimeFormat
    Returns
    Type Description
    bool
    | Edit this page View Source

    LoadDataFromCsvContentAsTimeSeries(CsvContent, char, out DateTime[], out Dictionary<string, double[]>, string)

    Version of LoadDataFromCSV that accepts a CSVcontent containting the contents of a CSV-file as input

    Declaration
    public static bool LoadDataFromCsvContentAsTimeSeries(CsvContent csvString, char separator, out DateTime[] dateTimes, out Dictionary<string, double[]> variables, string dateTimeFormat = "yyyy-MM-dd HH:mm:ss")
    Parameters
    Type Name Description
    CsvContent csvString
    char separator
    DateTime[] dateTimes
    Dictionary<string, double[]> variables
    string dateTimeFormat
    Returns
    Type Description
    bool
    | Edit this page View Source

    LoadStringsFromCSV(string, out string[,])

    Return just string data from a CSV(useful if data contains no numerical data)

    Declaration
    public static bool LoadStringsFromCSV(string filename, out string[,] stringData)
    Parameters
    Type Name Description
    string filename
    string[,] stringData
    Returns
    Type Description
    bool
    | Edit this page View Source

    RobustParseDouble(string, out double)

    Loading string data into a double value.

    Declaration
    public static bool RobustParseDouble(string str, out double value)
    Parameters
    Type Name Description
    string str

    the string to be parsed

    double value

    (output) is the value of the parsed double(if successfully parsed)

    Returns
    Type Description
    bool

    The method returns true if succesful, otherwise it returns false.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX