DataFrame
public struct DataFrame
A pandas-inspired dataframe. Dataframe is a tabular data representation. This particular Dataframe implementation is most useful to implement data feeder pipeline. You need some transformations so some text or images can be transformed into tensors for a model to consume. Dataframe can be used to implement that pipeline.
-
List of columns within this dataframe.
Declaration
Swift
public var columns: [String] { get } -
Initialize a dataframe from a sequence of objects.
Declaration
Swift
public init<S>(from sequence: S, name: String = "0") where S : Sequence -
Shuffle the dataframe.
Declaration
Swift
public mutating func shuffle() -
Declaration
Swift
public subscript(firstIndex: String, secondIndex: String, indices: String...) -> ManyUntypedSeries { get } -
Declaration
Swift
public subscript<S>(indices: S) -> ManyUntypedSeries where S : Sequence, S.Element == String { get } -
Declaration
Swift
public subscript(index: String) -> UntypedSeries? { get set } -
Declaration
Swift
public subscript<Element>(index: String, type: Element.Type = Element.self) -> TypedSeries< Element > -
How many rows in the dataframe.
Declaration
Swift
public var count: Int { get } -
Load CSV file into dataframe. This may use multi-threads when available.
Declaration
Swift
public init?( fromCSV filePath: String, automaticUseHeader: Bool = true, delimiter: String = ",", quotation: String = "\"" )Parameters
fromCSVThe file path for the CSV file.
automaticUseHeaderWhether the first line will be the header or not.
delimiterWhat’s the delimiter for the CSV file, default ,
quotationWhat’s the quotation mark for the CSV file, default “
-
Declaration
Swift
public struct UntypedSeries : DataSeries -
Declaration
Swift
public struct TypedSeries<Element> : DataSeries -
Declaration
Swift
public struct ManyUntypedSeries : DataSeries -
Result represent a tuple of tensors that you can access either by name or by tuple index.
See moreDeclaration
Swift
public struct ManyUntypedSeriesTensorResult
DataFrame Structure Reference