// NewDataFrameFromShape is the same as NewDataFrameFromColumns only it allows you to specify the number
// of rows in the DataFrame.
NewDataFrameFromShape is the same as NewDataFrameFromColumns only it allows you to specify the number
of rows in the DataFrame.
// NewDataFrameFromShape is the same as NewDataFrameFromColumns only it allows you to specify the number // of rows in the DataFrame .
func NewDataFrameFromShape(mem memory.Allocator, cols []array.Column, rows int64) (*DataFrame, error) {
	df := &DataFrame{
		refs:    1,
		mem:     mem,
		schema:  buildSchema(cols),
		cols:    cols,
		rows:    rows,
		mutator: NewMutator(mem),
	}
	if err := df.validate(); err != nil {
		return nil, err
	}
	for i := range df.cols {
		df.cols[i].Retain()
	}
	return df, nil
}
func NewDataFrameFromShape ( mem memory . Allocator , cols [ ] array . Column , rows int64 ) ( * DataFrame , error ) { df := & DataFrame { refs : 1 , mem : mem , schema : buildSchema ( cols ) , cols : cols , rows : rows , mutator : NewMutator ( mem ) , } if err := df . validate ( ) ; err != nil { return nil , err } for i := range df . cols { df . cols [ i ] . Retain ( ) } return df , nil }
NewDataFrameFromShape is the same as NewDataFrameFromColumns only it allows you to specify the number
of rows in the DataFrame.
NewDataFrameFromShape is the same as NewDataFrameFromColumns only it allows you to specify the number of rows in the DataFrame .
// validate the data frame and its constituents. // note we retain the columns after having validated the data frame // in case the validation fails and panics (and would otherwise leak // a ref-count on the columns.)