Documentation ¶
Index ¶
- func Stream(path, fileName string, c chan StreamingRecord)
- func UploadFileToAwsS3(path, filename, bucket, region string) error
- type DataFrame
- func CreateDataFrame(path, fileName string) DataFrame
- func CreateDataFrameFromAwsS3(path, item, bucket, region, awsAccessKey, awsSecretKey string) DataFrame
- func CreateDataFrameFromBytes(b []byte) DataFrame
- func CreateDataFrameFromCsvReader(reader *csv.Reader) DataFrame
- func CreateNewDataFrame(headers []string) DataFrame
- func LoadFrames(filePath string, files []string) ([]DataFrame, error)
- func Merge(dfs ...DataFrame) (DataFrame, error)
- func (frame DataFrame) AddRecord(newData []string) DataFrame
- func (frame *DataFrame) AddRecordByReference(newData []string)
- func (frame *DataFrame) Average(fieldName string) float64
- func (frame *DataFrame) ColumnVal(fieldName string, headers map[string]int) []string
- func (frame DataFrame) Columns() []string
- func (frame DataFrame) ConcatFrames(dfNew *DataFrame) (DataFrame, error)
- func (frame DataFrame) Copy() DataFrame
- func (frame *DataFrame) CountRecords() int
- func (frame DataFrame) Exclude(fieldName string, value ...string) DataFrame
- func (frame DataFrame) Filtered(fieldName string, value ...string) DataFrame
- func (frame DataFrame) FilteredAfter(fieldName, desiredDate string) DataFrame
- func (frame DataFrame) FilteredBefore(fieldName, desiredDate string) DataFrame
- func (frame DataFrame) FilteredBetween(fieldName, startDate, endDate string) DataFrame
- func (frame DataFrame) GreaterThanOrEqualTo(fieldName string, value float64) (DataFrame, error)
- func (frame DataFrame) InnerMerge(dfRight *DataFrame, primaryKey string) DataFrame
- func (frame DataFrame) KeepColumns(columns []string) DataFrame
- func (frame DataFrame) LessThanOrEqualTo(fieldName string, value float64) (DataFrame, error)
- func (frame *DataFrame) Max(fieldName string) float64
- func (frame DataFrame) Merge(dfRight *DataFrame, primaryKey string, columns ...string)
- func (frame *DataFrame) Min(fieldName string) float64
- func (frame *DataFrame) NewField(fieldName string)
- func (frame DataFrame) RemoveColumns(columns ...string) DataFrame
- func (frame *DataFrame) Rename(originalColumnName, newColumnName string) error
- func (frame *DataFrame) SaveDataFrame(path, fileName string) bool
- func (frame *DataFrame) Sort(columnName string)
- func (frame *DataFrame) SortByColumns(columns []string, sortOrders []bool, dataTypes []interface{})
- func (frame *DataFrame) StandardDeviation(fieldName string) (float64, error)
- func (frame *DataFrame) Sum(fieldName string) float64
- func (frame *DataFrame) Unique(fieldName string) []string
- func (frame DataFrame) ViewColumns()
- func (frame DataFrame) Where(fieldName, operator, value string) DataFrame
- type Record
- func (x Record) ConvertToDate(fieldName string, headers map[string]int) time.Time
- func (x Record) ConvertToFloat(fieldName string, headers map[string]int) float64
- func (x Record) ConvertToInt(fieldName string, headers map[string]int) int64
- func (x Record) SafeConvertToFloat(fieldName string, headers map[string]int) (float64, error)
- func (x Record) SafeConvertToInt(fieldName string, headers map[string]int) (int64, error)
- func (x Record) SafeUpdate(fieldName, value string, headers map[string]int) error
- func (x Record) SafeVal(fieldName string, headers map[string]int) (string, error)
- func (x Record) Update(fieldName, value string, headers map[string]int)
- func (x Record) Val(fieldName string, headers map[string]int) string
- type StreamingRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Stream ¶
func Stream(path, fileName string, c chan StreamingRecord)
Stream rows of data from a csv file to be processed. Streaming data is preferred when dealing with large files and memory usage needs to be considered. Results are streamed via a channel with a StreamingRecord type.
func UploadFileToAwsS3 ¶
Types ¶
type DataFrame ¶
func CreateDataFrame ¶
Generate a new DataFrame sourced from a csv file.
func CreateDataFrameFromBytes ¶
Generate a new DataFrame sourced from an array of bytes containing csv data.
func CreateDataFrameFromCsvReader ¶
Generate a new DataFrame sourced from a csv reader.
func CreateNewDataFrame ¶
Generate a new empty DataFrame.
func LoadFrames ¶
Concurrently loads multiple csv files into DataFrames within the same directory. Returns a slice with the DataFrames in the same order as provided in the files parameter.
func (*DataFrame) AddRecordByReference ¶ added in v1.0.8
Add a new record to the DataFrame
func (DataFrame) ConcatFrames ¶
Stack two DataFrames with matching headers.
func (DataFrame) Copy ¶
Generates a decoupled copy of an existing DataFrame. Changes made to either the original or new copied frame will not be reflected in the other.
func (*DataFrame) CountRecords ¶
func (DataFrame) Exclude ¶
Generates a new DataFrame that excludes specified instances. New DataFrame will be kept in same order as original.
func (DataFrame) Filtered ¶
Generates a new filtered DataFrame. New DataFrame will be kept in same order as original.
func (DataFrame) FilteredAfter ¶
Generates a new filtered DataFrame with all records occuring after a specified date provided by the user. User must provide the date field as well as the desired date. Instances where record dates occur on the same date provided by the user will not be included. Records must occur after the specified date.
func (DataFrame) FilteredBefore ¶
Generates a new filtered DataFrame with all records occuring before a specified date provided by the user. User must provide the date field as well as the desired date. Instances where record dates occur on the same date provided by the user will not be included. Records must occur before the specified date.
func (DataFrame) FilteredBetween ¶
Generates a new filtered DataFrame with all records occuring between a specified date range provided by the user. User must provide the date field as well as the desired date. Instances where record dates occur on the same date provided by the user will not be included. Records must occur between the specified start and end dates.
func (DataFrame) GreaterThanOrEqualTo ¶
Generated a new filtered DataFrame that in which a numerical column is either greater than or equal to a provided numerical value.
func (DataFrame) InnerMerge ¶
Performs an inner merge where all columns are consolidated between the two frames but only for records where the specified primary key is found in both frames.
func (DataFrame) KeepColumns ¶
User specifies columns they want to keep from a preexisting DataFrame
func (DataFrame) LessThanOrEqualTo ¶
Generated a new filtered DataFrame that in which a numerical column is either less than or equal to a provided numerical value.
func (DataFrame) Merge ¶
Import all columns from right frame into left frame if no columns are provided by the user. Process must be done so in order.
func (DataFrame) RemoveColumns ¶
User specifies columns they want to remove from a preexisting DataFrame
func (*DataFrame) SaveDataFrame ¶
func (*DataFrame) SortByColumns ¶ added in v1.0.5
Sort the dataframe by columns
func (*DataFrame) StandardDeviation ¶
Return the standard deviation of a numerical field.
func (DataFrame) ViewColumns ¶
func (frame DataFrame) ViewColumns()
Method to print all columns in a viewable table within the terminal.
type Record ¶
type Record struct {
Data []string
}
func (Record) ConvertToDate ¶
Converts date from specified field to time.Time
func (Record) ConvertToFloat ¶
Converts the value from a string to float64.
func (Record) ConvertToInt ¶
Converts the value from string to int64.
func (Record) SafeConvertToFloat ¶ added in v1.0.5
Converts the value from a string to float64.
func (Record) SafeConvertToInt ¶ added in v1.0.5
Converts the value from a string to int64.
func (Record) SafeUpdate ¶ added in v1.0.5
Update the value in a specified field. If the provided field name is not in the headers map, error is returned.
func (Record) SafeVal ¶ added in v1.0.5
Return the value of the specified field. If the provided field name is not in the headers map, error is returned.
type StreamingRecord ¶
func (StreamingRecord) ConvertToFloat ¶
func (x StreamingRecord) ConvertToFloat(fieldName string) float64
Converts the value from a string to float64
func (StreamingRecord) ConvertToInt ¶
func (x StreamingRecord) ConvertToInt(fieldName string) int64
Converts the value from a string to int64
func (StreamingRecord) Val ¶
func (x StreamingRecord) Val(fieldName string) string
Return the value of the specified field.