代码拉取完成,页面将自动刷新
package pandas
import "gitee.com/quant1x/pandas/stat"
// Read/Write Methods
// =================
// LoadOption is the type used to configure the load of elements
type LoadOption func(*loadOptions)
type loadOptions struct {
// Specifies which is the default type in case detectTypes is disabled.
defaultType stat.Type
// If set, the type of each column will be automatically detected unless
// otherwise specified.
detectTypes bool
// If set, the first row of the tabular structure will be used as column
// names.
hasHeader bool
// The names to set as columns names.
names []string
// Defines which values are going to be considered as NaN when parsing from string.
nanValues []string
// Defines the csv delimiter
delimiter rune
// EnablesLazyQuotes
lazyQuotes bool
// Defines the comment delimiter
comment rune
// The types of specific columns can be specified via column name.
types map[string]stat.Type
}
// DefaultType sets the defaultType option for loadOptions.
func DefaultType(t stat.Type) LoadOption {
return func(c *loadOptions) {
c.defaultType = t
}
}
// DetectTypes sets the detectTypes option for loadOptions.
func DetectTypes(b bool) LoadOption {
return func(c *loadOptions) {
c.detectTypes = b
}
}
// HasHeader sets the hasHeader option for loadOptions.
func HasHeader(b bool) LoadOption {
return func(c *loadOptions) {
c.hasHeader = b
}
}
// Names sets the names option for loadOptions.
func Names(names ...string) LoadOption {
return func(c *loadOptions) {
c.names = names
}
}
// NaNValues sets the nanValues option for loadOptions.
func NaNValues(nanValues []string) LoadOption {
return func(c *loadOptions) {
c.nanValues = nanValues
}
}
// WithTypes sets the types option for loadOptions.
func WithTypes(coltypes map[string]stat.Type) LoadOption {
return func(c *loadOptions) {
c.types = coltypes
}
}
// WithDelimiter sets the csv delimiter other than ',', for example '\t'
func WithDelimiter(b rune) LoadOption {
return func(c *loadOptions) {
c.delimiter = b
}
}
// WithLazyQuotes sets csv parsing option to LazyQuotes
func WithLazyQuotes(b bool) LoadOption {
return func(c *loadOptions) {
c.lazyQuotes = b
}
}
// WithComments sets the csv comment line detect to remove lines
func WithComments(b rune) LoadOption {
return func(c *loadOptions) {
c.comment = b
}
}
// WriteOption is the type used to configure the writing of elements
type WriteOption func(*writeOptions)
type writeOptions struct {
// Specifies whether the header is also written
writeHeader bool
}
// WriteHeader sets the writeHeader option for writeOptions.
func WriteHeader(b bool) WriteOption {
return func(c *writeOptions) {
c.writeHeader = b
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。