Documentation
¶
Overview ¶
Package datetime provides comprehensive temporal data handling for Golars. It includes support for dates, times, timestamps, durations, timezones, and various calendar operations that integrate seamlessly with the DataFrame and Series APIs.
The package supports nanosecond precision timestamps, timezone-aware operations, business day calculations, and flexible parsing/formatting capabilities.
Example:
df := golars.NewDataFrame(
golars.NewDateTimeSeries("timestamp", []time.Time{
time.Now(),
time.Now().Add(24 * time.Hour),
time.Now().Add(48 * time.Hour),
}),
)
result := df.WithColumn("year",
golars.Col("timestamp").Dt().Year(),
).WithColumn("is_weekend",
golars.Col("timestamp").Dt().IsWeekend(),
)
Index ¶
- func ExtractDay(timestamps []int64, tz *time.Location) []int8
- func ExtractHour(timestamps []int64, tz *time.Location) []int8
- func ExtractMinute(timestamps []int64, tz *time.Location) []int8
- func ExtractMonth(timestamps []int64, tz *time.Location) []int8
- func ExtractSecond(timestamps []int64, tz *time.Location) []int8
- func ExtractYear(timestamps []int64, tz *time.Location) []int32
- func FormatDuration(d Duration) string
- func FormatWithPolarsStyle(dt DateTime, format string) string
- func LoadTimezone(name string) (*time.Location, error)
- func NewDateSeries(name string, values []time.Time) series.Series
- func NewDateSeriesFromStrings(name string, values []string, format string) (series.Series, error)
- func NewDateTimeSeries(name string, values []time.Time) series.Series
- func NewDateTimeSeriesFromEpoch(name string, values []int64, unit TimeUnit) series.Series
- func NewDateTimeSeriesFromStrings(name string, values []string, format string) (series.Series, error)
- func NewTimeSeries(name string, hours, minutes, seconds []int) (series.Series, error)
- func StrToDate(e expr.Expr, format string) expr.Expr
- func StrToDateTime(e expr.Expr, format string) expr.Expr
- func StrToTime(e expr.Expr, format string) expr.Expr
- type Date
- type DateRangeBuilder
- func (b *DateRangeBuilder) Build() ([]DateTime, error)
- func (b *DateRangeBuilder) Closed(c string) *DateRangeBuilder
- func (b *DateRangeBuilder) Count(n int) *DateRangeBuilder
- func (b *DateRangeBuilder) End(dt DateTime) *DateRangeBuilder
- func (b *DateRangeBuilder) Frequency(freq Duration) *DateRangeBuilder
- func (b *DateRangeBuilder) Inclusive(inc string) *DateRangeBuilder
- func (b *DateRangeBuilder) Start(dt DateTime) *DateRangeBuilder
- func (b *DateRangeBuilder) Timezone(tz *time.Location) *DateRangeBuilder
- type DateTime
- func BusinessDayRange(start, end time.Time) ([]DateTime, error)
- func DateRange(start, end time.Time, freq Duration) ([]DateTime, error)
- func DateRangeFromString(start, end string, freq string) ([]DateTime, error)
- func DateRangeWithCount(start time.Time, freq Duration, count int) ([]DateTime, error)
- func NewDateTime(t time.Time) DateTime
- func ParseDateTime(value string) (DateTime, error)
- func ParseDateTimeFromEpoch(epoch int64, unit TimeUnit) DateTime
- func ParseDateTimeWithFormat(value string, format string) (DateTime, error)
- func ParseDateTimeWithTimezone(value string, tz *time.Location) (DateTime, error)
- func (dt DateTime) Add(d Duration) DateTime
- func (dt DateTime) Ceil(unit TimeUnit) DateTime
- func (dt DateTime) ConvertTimezone(tz *time.Location) DateTime
- func (dt DateTime) Day() int
- func (dt DateTime) DayOfWeek() int
- func (dt DateTime) DayOfYear() int
- func (dt DateTime) Floor(unit TimeUnit) DateTime
- func (dt DateTime) Format(layout string) string
- func (dt DateTime) Hour() int
- func (dt DateTime) ISOFormat() string
- func (dt DateTime) ISOYear() int
- func (dt DateTime) InTimezone(tzName string) (DateTime, error)
- func (dt DateTime) IsLeapYear() bool
- func (dt DateTime) IsMonthEnd() bool
- func (dt DateTime) IsMonthStart() bool
- func (dt DateTime) IsQuarterEnd() bool
- func (dt DateTime) IsQuarterStart() bool
- func (dt DateTime) IsWeekend() bool
- func (dt DateTime) IsYearEnd() bool
- func (dt DateTime) IsYearStart() bool
- func (dt DateTime) Microsecond() int
- func (dt DateTime) Millisecond() int
- func (dt DateTime) Minute() int
- func (dt DateTime) Month() time.Month
- func (dt DateTime) Nanosecond() int
- func (dt DateTime) Quarter() int
- func (dt DateTime) Round(unit TimeUnit) DateTime
- func (dt DateTime) Second() int
- func (dt DateTime) String() string
- func (dt DateTime) Sub(d Duration) DateTime
- func (dt DateTime) Time() time.Time
- func (dt DateTime) ToLocal() DateTime
- func (dt DateTime) ToTimezone(tz *time.Location) DateTime
- func (dt DateTime) ToUTC() DateTime
- func (dt DateTime) Truncate(unit TimeUnit) DateTime
- func (dt DateTime) WeekOfYear() int
- func (dt DateTime) WithTimezone(tz *time.Location) DateTime
- func (dt DateTime) Year() int
- type DateTimeAddExpr
- type DateTimeArithmetic
- type DateTimeComponentExpr
- type DateTimeDiffExpr
- type DateTimeExpr
- func (dte *DateTimeExpr) Add(duration Duration) expr.Expr
- func (dte *DateTimeExpr) Ceil(unit TimeUnit) expr.Expr
- func (dte *DateTimeExpr) ConvertTimezone(tzName string) expr.Expr
- func (dte *DateTimeExpr) Day() expr.Expr
- func (dte *DateTimeExpr) DayOfWeek() expr.Expr
- func (dte *DateTimeExpr) DayOfYear() expr.Expr
- func (dte *DateTimeExpr) Diff(other expr.Expr) expr.Expr
- func (dte *DateTimeExpr) Floor(unit TimeUnit) expr.Expr
- func (dte *DateTimeExpr) Format(format string) expr.Expr
- func (dte *DateTimeExpr) Hour() expr.Expr
- func (dte *DateTimeExpr) Minute() expr.Expr
- func (dte *DateTimeExpr) Month() expr.Expr
- func (dte *DateTimeExpr) Nanosecond() expr.Expr
- func (dte *DateTimeExpr) Quarter() expr.Expr
- func (dte *DateTimeExpr) Resample(frequency string) *ResampleExpr
- func (dte *DateTimeExpr) Round(unit TimeUnit) expr.Expr
- func (dte *DateTimeExpr) Second() expr.Expr
- func (dte *DateTimeExpr) Sub(duration Duration) expr.Expr
- func (dte *DateTimeExpr) ToLocal() expr.Expr
- func (dte *DateTimeExpr) ToUTC() expr.Expr
- func (dte *DateTimeExpr) Truncate(unit TimeUnit) expr.Expr
- func (dte *DateTimeExpr) WeekOfYear() expr.Expr
- func (dte *DateTimeExpr) Year() expr.Expr
- type DateTimeFormatExpr
- type DateTimeRoundExpr
- type DateTimeSeries
- func (dts *DateTimeSeries) Add(duration Duration) series.Series
- func (dts *DateTimeSeries) AddBusinessDays(days int) series.Series
- func (dts *DateTimeSeries) ConvertTimezone(tzName string) (series.Series, error)
- func (dts *DateTimeSeries) Day() series.Series
- func (dts *DateTimeSeries) DayOfWeek() series.Series
- func (dts *DateTimeSeries) DayOfYear() series.Series
- func (dts *DateTimeSeries) Diff(other series.Series) (series.Series, error)
- func (dts *DateTimeSeries) Floor(unit TimeUnit) series.Series
- func (dts *DateTimeSeries) Format(layout string) series.Series
- func (dts *DateTimeSeries) GetTimezone() string
- func (dts *DateTimeSeries) Hour() series.Series
- func (dts *DateTimeSeries) IsLeapYear() series.Series
- func (dts *DateTimeSeries) IsWeekend() series.Series
- func (dts *DateTimeSeries) Localize(tzName string) (series.Series, error)
- func (dts *DateTimeSeries) Minute() series.Series
- func (dts *DateTimeSeries) Month() series.Series
- func (dts *DateTimeSeries) Quarter() series.Series
- func (dts *DateTimeSeries) Resample(rule *ResampleRule) (*ResampleGrouper, error)
- func (dts *DateTimeSeries) Second() series.Series
- func (dts *DateTimeSeries) Sub(duration Duration) series.Series
- func (dts *DateTimeSeries) ToLocal() series.Series
- func (dts *DateTimeSeries) ToUTC() series.Series
- func (dts *DateTimeSeries) Year() series.Series
- type DateTimeSubExpr
- type Duration
- func Days(n int) Duration
- func Hours(n int) Duration
- func Microseconds(n int) Duration
- func Milliseconds(n int) Duration
- func Minutes(n int) Duration
- func Months(n int) Duration
- func Nanoseconds(n int64) Duration
- func NewDuration(months, days int32, nanoseconds int64) Duration
- func ParseDuration(s string) (Duration, error)
- func Seconds(n int) Duration
- func Weeks(n int) Duration
- func Years(n int) Duration
- type ResampleExpr
- type ResampleGrouper
- func (rg *ResampleGrouper) Aggregate(agg string, targetSeries series.Series) (series.Series, error)
- func (rg *ResampleGrouper) Count() (series.Series, error)
- func (rg *ResampleGrouper) Mean(targetSeries series.Series) (series.Series, error)
- func (rg *ResampleGrouper) Sum(targetSeries series.Series) (series.Series, error)
- type ResampleRule
- type StrToDateExpr
- type StrToDateTimeExpr
- type StrToTimeExpr
- type Time
- type TimeUnit
- type TimezoneConvertExpr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶
func FormatWithPolarsStyle ¶
func LoadTimezone ¶
LoadTimezone loads a timezone by name
func NewDateSeries ¶
NewDateSeries creates a new Date series from time.Time values
func NewDateSeriesFromStrings ¶
NewDateSeriesFromStrings creates a Date series from string values
func NewDateTimeSeries ¶
NewDateTimeSeries creates a new DateTime series from time.Time values
func NewDateTimeSeriesFromEpoch ¶
NewDateTimeSeriesFromEpoch creates a DateTime series from epoch values
func NewDateTimeSeriesFromStrings ¶
func NewDateTimeSeriesFromStrings(name string, values []string, format string) (series.Series, error)
NewDateTimeSeriesFromStrings creates a DateTime series from string values
func NewTimeSeries ¶
NewTimeSeries creates a new Time series
func StrToDateTime ¶
StrToDateTime converts a string expression to datetime
Types ¶
type Date ¶
type Date struct {
// contains filtered or unexported fields
}
Date represents a calendar date without time
func NewDateFromTime ¶
NewDateFromTime creates a Date from a time.Time
type DateRangeBuilder ¶
type DateRangeBuilder struct {
// contains filtered or unexported fields
}
func NewDateRangeBuilder ¶
func NewDateRangeBuilder() *DateRangeBuilder
func (*DateRangeBuilder) Build ¶
func (b *DateRangeBuilder) Build() ([]DateTime, error)
func (*DateRangeBuilder) Closed ¶
func (b *DateRangeBuilder) Closed(c string) *DateRangeBuilder
func (*DateRangeBuilder) Count ¶
func (b *DateRangeBuilder) Count(n int) *DateRangeBuilder
func (*DateRangeBuilder) End ¶
func (b *DateRangeBuilder) End(dt DateTime) *DateRangeBuilder
func (*DateRangeBuilder) Frequency ¶
func (b *DateRangeBuilder) Frequency(freq Duration) *DateRangeBuilder
func (*DateRangeBuilder) Inclusive ¶
func (b *DateRangeBuilder) Inclusive(inc string) *DateRangeBuilder
func (*DateRangeBuilder) Start ¶
func (b *DateRangeBuilder) Start(dt DateTime) *DateRangeBuilder
func (*DateRangeBuilder) Timezone ¶
func (b *DateRangeBuilder) Timezone(tz *time.Location) *DateRangeBuilder
type DateTime ¶
type DateTime struct {
// contains filtered or unexported fields
}
DateTime represents a point in time with timezone information
func DateRangeFromString ¶
func DateRangeWithCount ¶
func ParseDateTime ¶
func ParseDateTimeFromEpoch ¶
func ParseDateTimeWithFormat ¶
func (DateTime) ConvertTimezone ¶
ConvertTimezone converts a DateTime to a different timezone
func (DateTime) InTimezone ¶
InTimezone converts the DateTime to the specified timezone
func (DateTime) IsLeapYear ¶
func (DateTime) IsMonthEnd ¶
func (DateTime) IsMonthStart ¶
func (DateTime) IsQuarterEnd ¶
func (DateTime) IsQuarterStart ¶
func (DateTime) IsYearStart ¶
func (DateTime) Microsecond ¶
func (DateTime) Millisecond ¶
func (DateTime) Nanosecond ¶
func (DateTime) ToTimezone ¶
ToTimezone converts the DateTime to a different timezone (different instant)
func (DateTime) WeekOfYear ¶
func (DateTime) WithTimezone ¶
WithTimezone returns a new DateTime with the specified timezone without changing the underlying timestamp
type DateTimeAddExpr ¶
type DateTimeAddExpr struct {
// contains filtered or unexported fields
}
DateTimeAddExpr represents adding a duration to a datetime expression
func (*DateTimeAddExpr) DataType ¶
func (e *DateTimeAddExpr) DataType() datatypes.DataType
func (*DateTimeAddExpr) IsColumn ¶
func (e *DateTimeAddExpr) IsColumn() bool
func (*DateTimeAddExpr) Name ¶
func (e *DateTimeAddExpr) Name() string
func (*DateTimeAddExpr) String ¶
func (e *DateTimeAddExpr) String() string
type DateTimeArithmetic ¶
type DateTimeArithmetic struct {
// contains filtered or unexported fields
}
DateTimeArithmetic provides arithmetic operations for DateTime series
type DateTimeComponentExpr ¶
type DateTimeComponentExpr struct {
// contains filtered or unexported fields
}
DateTimeComponentExpr represents a datetime component extraction
func (*DateTimeComponentExpr) DataType ¶
func (e *DateTimeComponentExpr) DataType() datatypes.DataType
func (*DateTimeComponentExpr) IsColumn ¶
func (e *DateTimeComponentExpr) IsColumn() bool
func (*DateTimeComponentExpr) Name ¶
func (e *DateTimeComponentExpr) Name() string
func (*DateTimeComponentExpr) String ¶
func (e *DateTimeComponentExpr) String() string
type DateTimeDiffExpr ¶
type DateTimeDiffExpr struct {
// contains filtered or unexported fields
}
DateTimeDiffExpr represents the difference between two datetime expressions
func (*DateTimeDiffExpr) DataType ¶
func (e *DateTimeDiffExpr) DataType() datatypes.DataType
func (*DateTimeDiffExpr) IsColumn ¶
func (e *DateTimeDiffExpr) IsColumn() bool
func (*DateTimeDiffExpr) Name ¶
func (e *DateTimeDiffExpr) Name() string
func (*DateTimeDiffExpr) String ¶
func (e *DateTimeDiffExpr) String() string
type DateTimeExpr ¶
type DateTimeExpr struct {
// contains filtered or unexported fields
}
DateTimeExpr provides datetime-specific operations on expressions
func DtExpr ¶
func DtExpr(e expr.Expr) *DateTimeExpr
DtExpr returns datetime operations for an expression
func (*DateTimeExpr) Add ¶
func (dte *DateTimeExpr) Add(duration Duration) expr.Expr
Add adds a duration to the datetime expression
func (*DateTimeExpr) Ceil ¶
func (dte *DateTimeExpr) Ceil(unit TimeUnit) expr.Expr
Ceil rounds up to the nearest unit
func (*DateTimeExpr) ConvertTimezone ¶
func (dte *DateTimeExpr) ConvertTimezone(tzName string) expr.Expr
ConvertTimezone creates an expression to convert datetime to a new timezone
func (*DateTimeExpr) DayOfWeek ¶
func (dte *DateTimeExpr) DayOfWeek() expr.Expr
DayOfWeek extracts the day of week
func (*DateTimeExpr) DayOfYear ¶
func (dte *DateTimeExpr) DayOfYear() expr.Expr
DayOfYear extracts the day of year
func (*DateTimeExpr) Diff ¶
func (dte *DateTimeExpr) Diff(other expr.Expr) expr.Expr
Diff calculates the difference with another datetime expression
func (*DateTimeExpr) Floor ¶
func (dte *DateTimeExpr) Floor(unit TimeUnit) expr.Expr
Floor rounds down to the nearest unit
func (*DateTimeExpr) Format ¶
func (dte *DateTimeExpr) Format(format string) expr.Expr
Format formats the datetime values
func (*DateTimeExpr) Hour ¶
func (dte *DateTimeExpr) Hour() expr.Expr
Hour extracts the hour component
func (*DateTimeExpr) Minute ¶
func (dte *DateTimeExpr) Minute() expr.Expr
Minute extracts the minute component
func (*DateTimeExpr) Month ¶
func (dte *DateTimeExpr) Month() expr.Expr
Month extracts the month component
func (*DateTimeExpr) Nanosecond ¶
func (dte *DateTimeExpr) Nanosecond() expr.Expr
Nanosecond extracts the nanosecond component
func (*DateTimeExpr) Quarter ¶
func (dte *DateTimeExpr) Quarter() expr.Expr
Quarter extracts the quarter
func (*DateTimeExpr) Resample ¶
func (dte *DateTimeExpr) Resample(frequency string) *ResampleExpr
Resample creates a resample expression
func (*DateTimeExpr) Round ¶
func (dte *DateTimeExpr) Round(unit TimeUnit) expr.Expr
Round rounds to the nearest unit
func (*DateTimeExpr) Second ¶
func (dte *DateTimeExpr) Second() expr.Expr
Second extracts the second component
func (*DateTimeExpr) Sub ¶
func (dte *DateTimeExpr) Sub(duration Duration) expr.Expr
Sub subtracts a duration from the datetime expression
func (*DateTimeExpr) ToLocal ¶
func (dte *DateTimeExpr) ToLocal() expr.Expr
ToLocal creates an expression to convert datetime to local timezone
func (*DateTimeExpr) ToUTC ¶
func (dte *DateTimeExpr) ToUTC() expr.Expr
ToUTC creates an expression to convert datetime to UTC
func (*DateTimeExpr) Truncate ¶
func (dte *DateTimeExpr) Truncate(unit TimeUnit) expr.Expr
Truncate is an alias for Floor
func (*DateTimeExpr) WeekOfYear ¶
func (dte *DateTimeExpr) WeekOfYear() expr.Expr
WeekOfYear extracts the week of year
func (*DateTimeExpr) Year ¶
func (dte *DateTimeExpr) Year() expr.Expr
Year extracts the year component
type DateTimeFormatExpr ¶
type DateTimeFormatExpr struct {
// contains filtered or unexported fields
}
DateTimeFormatExpr represents datetime formatting
func (*DateTimeFormatExpr) DataType ¶
func (e *DateTimeFormatExpr) DataType() datatypes.DataType
func (*DateTimeFormatExpr) IsColumn ¶
func (e *DateTimeFormatExpr) IsColumn() bool
func (*DateTimeFormatExpr) Name ¶
func (e *DateTimeFormatExpr) Name() string
func (*DateTimeFormatExpr) String ¶
func (e *DateTimeFormatExpr) String() string
type DateTimeRoundExpr ¶
type DateTimeRoundExpr struct {
// contains filtered or unexported fields
}
DateTimeRoundExpr represents datetime rounding operations
func (*DateTimeRoundExpr) DataType ¶
func (e *DateTimeRoundExpr) DataType() datatypes.DataType
func (*DateTimeRoundExpr) IsColumn ¶
func (e *DateTimeRoundExpr) IsColumn() bool
func (*DateTimeRoundExpr) Name ¶
func (e *DateTimeRoundExpr) Name() string
func (*DateTimeRoundExpr) String ¶
func (e *DateTimeRoundExpr) String() string
type DateTimeSeries ¶
type DateTimeSeries struct {
// contains filtered or unexported fields
}
DateTimeSeries wraps a Series with DateTime operations
func DtSeries ¶
func DtSeries(s series.Series) (*DateTimeSeries, error)
DtSeries returns DateTime operations for a Series
func (*DateTimeSeries) Add ¶
func (dts *DateTimeSeries) Add(duration Duration) series.Series
Add adds a duration to each datetime value
func (*DateTimeSeries) AddBusinessDays ¶
func (dts *DateTimeSeries) AddBusinessDays(days int) series.Series
AddBusinessDays adds business days to datetime/date series
func (*DateTimeSeries) ConvertTimezone ¶
func (dts *DateTimeSeries) ConvertTimezone(tzName string) (series.Series, error)
ConvertTimezone converts all datetime values in the series to a new timezone
func (*DateTimeSeries) Day ¶
func (dts *DateTimeSeries) Day() series.Series
Day extracts the day component
func (*DateTimeSeries) DayOfWeek ¶
func (dts *DateTimeSeries) DayOfWeek() series.Series
DayOfWeek extracts the day of week (0=Sunday, 6=Saturday)
func (*DateTimeSeries) DayOfYear ¶
func (dts *DateTimeSeries) DayOfYear() series.Series
DayOfYear extracts the day of year
func (*DateTimeSeries) Floor ¶
func (dts *DateTimeSeries) Floor(unit TimeUnit) series.Series
Floor rounds down to the specified time unit
func (*DateTimeSeries) Format ¶
func (dts *DateTimeSeries) Format(layout string) series.Series
Format formats the DateTime values according to the given layout
func (*DateTimeSeries) GetTimezone ¶
func (dts *DateTimeSeries) GetTimezone() string
GetTimezone returns the timezone of the datetime series
func (*DateTimeSeries) Hour ¶
func (dts *DateTimeSeries) Hour() series.Series
Hour extracts the hour component
func (*DateTimeSeries) IsLeapYear ¶
func (dts *DateTimeSeries) IsLeapYear() series.Series
IsLeapYear returns a boolean series indicating leap years
func (*DateTimeSeries) IsWeekend ¶
func (dts *DateTimeSeries) IsWeekend() series.Series
IsWeekend returns a boolean series indicating whether each datetime is a weekend
func (*DateTimeSeries) Localize ¶
func (dts *DateTimeSeries) Localize(tzName string) (series.Series, error)
Localize interprets naive timestamps as being in the specified timezone
func (*DateTimeSeries) Minute ¶
func (dts *DateTimeSeries) Minute() series.Series
Minute extracts the minute component
func (*DateTimeSeries) Month ¶
func (dts *DateTimeSeries) Month() series.Series
Month extracts the month component
func (*DateTimeSeries) Quarter ¶
func (dts *DateTimeSeries) Quarter() series.Series
Quarter extracts the quarter (1-4)
func (*DateTimeSeries) Resample ¶
func (dts *DateTimeSeries) Resample(rule *ResampleRule) (*ResampleGrouper, error)
Resample groups datetime series by time frequency
func (*DateTimeSeries) Second ¶
func (dts *DateTimeSeries) Second() series.Series
Second extracts the second component
func (*DateTimeSeries) Sub ¶
func (dts *DateTimeSeries) Sub(duration Duration) series.Series
Sub subtracts a duration from each datetime value
func (*DateTimeSeries) ToLocal ¶
func (dts *DateTimeSeries) ToLocal() series.Series
ToLocal converts all datetime values to local timezone
func (*DateTimeSeries) ToUTC ¶
func (dts *DateTimeSeries) ToUTC() series.Series
ToUTC converts all datetime values to UTC
func (*DateTimeSeries) Year ¶
func (dts *DateTimeSeries) Year() series.Series
Year extracts the year component
type DateTimeSubExpr ¶
type DateTimeSubExpr struct {
// contains filtered or unexported fields
}
DateTimeSubExpr represents subtracting a duration from a datetime expression
func (*DateTimeSubExpr) DataType ¶
func (e *DateTimeSubExpr) DataType() datatypes.DataType
func (*DateTimeSubExpr) IsColumn ¶
func (e *DateTimeSubExpr) IsColumn() bool
func (*DateTimeSubExpr) Name ¶
func (e *DateTimeSubExpr) Name() string
func (*DateTimeSubExpr) String ¶
func (e *DateTimeSubExpr) String() string
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
Duration represents a time duration with support for calendar units
func Microseconds ¶
Microseconds creates a duration of n microseconds
func Milliseconds ¶
Milliseconds creates a duration of n milliseconds
func Nanoseconds ¶
Nanoseconds creates a duration of n nanoseconds
func NewDuration ¶
NewDuration creates a new duration
func ParseDuration ¶
type ResampleExpr ¶
type ResampleExpr struct {
// contains filtered or unexported fields
}
ResampleExpr represents a resample operation in the expression API
func (*ResampleExpr) DataType ¶
func (e *ResampleExpr) DataType() datatypes.DataType
func (*ResampleExpr) IsColumn ¶
func (e *ResampleExpr) IsColumn() bool
func (*ResampleExpr) Name ¶
func (e *ResampleExpr) Name() string
func (*ResampleExpr) String ¶
func (e *ResampleExpr) String() string
type ResampleGrouper ¶
type ResampleGrouper struct {
// contains filtered or unexported fields
}
ResampleGrouper handles resampled groups
func (*ResampleGrouper) Count ¶
func (rg *ResampleGrouper) Count() (series.Series, error)
Count returns count of values in each bin
type ResampleRule ¶
type ResampleRule struct {
Frequency string // Frequency string like "1D", "1H", "5min"
Closed string // "left" or "right" - which side of bin is closed
Label string // "left" or "right" - which edge to use for result label
Origin *time.Time // Origin time for grouping
}
ResampleRule defines how to resample time series data
func NewResampleRule ¶
func NewResampleRule(frequency string) *ResampleRule
NewResampleRule creates a new resample rule with defaults
type StrToDateExpr ¶
type StrToDateExpr struct {
// contains filtered or unexported fields
}
StrToDateExpr converts string to date
func (*StrToDateExpr) DataType ¶
func (e *StrToDateExpr) DataType() datatypes.DataType
func (*StrToDateExpr) IsColumn ¶
func (e *StrToDateExpr) IsColumn() bool
func (*StrToDateExpr) Name ¶
func (e *StrToDateExpr) Name() string
func (*StrToDateExpr) String ¶
func (e *StrToDateExpr) String() string
type StrToDateTimeExpr ¶
type StrToDateTimeExpr struct {
// contains filtered or unexported fields
}
StrToDateTimeExpr converts string to datetime
func (*StrToDateTimeExpr) DataType ¶
func (e *StrToDateTimeExpr) DataType() datatypes.DataType
func (*StrToDateTimeExpr) IsColumn ¶
func (e *StrToDateTimeExpr) IsColumn() bool
func (*StrToDateTimeExpr) Name ¶
func (e *StrToDateTimeExpr) Name() string
func (*StrToDateTimeExpr) String ¶
func (e *StrToDateTimeExpr) String() string
type StrToTimeExpr ¶
type StrToTimeExpr struct {
// contains filtered or unexported fields
}
StrToTimeExpr converts string to time
func (*StrToTimeExpr) DataType ¶
func (e *StrToTimeExpr) DataType() datatypes.DataType
func (*StrToTimeExpr) IsColumn ¶
func (e *StrToTimeExpr) IsColumn() bool
func (*StrToTimeExpr) Name ¶
func (e *StrToTimeExpr) Name() string
func (*StrToTimeExpr) String ¶
func (e *StrToTimeExpr) String() string
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time represents time of day without date
type TimeUnit ¶
type TimeUnit int
TimeUnit represents the precision of temporal data
func (TimeUnit) ToArrowTimeUnit ¶
ToArrowTimeUnit converts TimeUnit to Arrow's TimeUnit
func (TimeUnit) ToDuration ¶
type TimezoneConvertExpr ¶
type TimezoneConvertExpr struct {
// contains filtered or unexported fields
}
TimezoneConvertExpr converts datetime to a new timezone
func (*TimezoneConvertExpr) DataType ¶
func (e *TimezoneConvertExpr) DataType() datatypes.DataType
func (*TimezoneConvertExpr) IsColumn ¶
func (e *TimezoneConvertExpr) IsColumn() bool
func (*TimezoneConvertExpr) Name ¶
func (e *TimezoneConvertExpr) Name() string
func (*TimezoneConvertExpr) String ¶
func (e *TimezoneConvertExpr) String() string