Skip to content

Commit

Permalink
fix issue go-gota#169
Browse files Browse the repository at this point in the history
  • Loading branch information
prliu committed Nov 26, 2021
1 parent f705409 commit ed5955b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dataframe/dataframe.go
Original file line number Diff line number Diff line change
Expand Up @@ -1219,17 +1219,22 @@ func LoadRecords(records [][]string, options ...LoadOption) DataFrame {
types := make([]series.Type, len(headers))
rawcols := make([][]string, len(headers))
for i, colname := range headers {
t, useCustomType := cfg.types[colname]
rawcol := make([]string, len(records))
for j := 0; j < len(records); j++ {
rawcol[j] = records[j][i]
if useCustomType && t == series.String {
// skip the convertion when using custom string type
continue
}
if findInStringSlice(rawcol[j], cfg.nanValues) != -1 {
rawcol[j] = "NaN"
}
}
rawcols[i] = rawcol

t, ok := cfg.types[colname]
if !ok {
// try to auto detect the data type
if !useCustomType {
t = cfg.defaultType
if cfg.detectTypes {
if l, err := findType(rawcol); err == nil {
Expand Down

0 comments on commit ed5955b

Please sign in to comment.