Giter VIP home page Giter VIP logo

Comments (19)

mullerhai avatar mullerhai commented on May 15, 2024

csv: invalid field or comment delimiter

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

UserID,MovieID,Rating,Timestamp
1,1193,5,978300760
1,661,3,978302109
1,914,3,978301968
1,3408,4,978300275
1,2355,5,978824291
1,1197,3,978302268

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

could you give me a example to use imports.CSVLoadOptions

from dataframe-go.

pjebs avatar pjebs commented on May 15, 2024

That error is from csv package from standard library which is used underneath.

https://golang.org/pkg/encoding/csv/

from dataframe-go.

pjebs avatar pjebs commented on May 15, 2024

Also the column names in csv data must match in dictate data type (including case)

from dataframe-go.

pjebs avatar pjebs commented on May 15, 2024

Also provide Comma setting to ,

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

could you give me example use CSVLoadOptions please ,very thx

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

type CSVLoadOptions struct Comma rune Comment rune ,
the rune type int32 ?? but // Comma is the field delimiter.
// The default value is ',' is string

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

if i need rune set value ?
csvOp.Comma ="," is error

from dataframe-go.

pjebs avatar pjebs commented on May 15, 2024

Try single quotes

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

var csvOp imports.CSVLoadOptions
{0 0 false false map[MOVIEID:0 RATING:0 TIMESTAMP:0 USERID:0] }
fmt.Println(csvOp)

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

please show me the code to run

from dataframe-go.

pjebs avatar pjebs commented on May 15, 2024

For dictate data type, your column names don't match your csv data. The case must match

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

see me code ,is the correct use CSVLoadOptions style

var ctx = context.Background()
file, err := os.Open(ratingPath)
//strings.NewReader(ratingPath)
var csvOp imports.CSVLoadOptions
//csvOp.Comma = 0
csvOp.DictateDataType =make(map[string]interface{})
csvOp.DictateDataType["USERID"]= float64(0)
csvOp.DictateDataType["MOVIEID"]=float64(0)
csvOp.DictateDataType["RATING"]=float64(0)
csvOp.DictateDataType["TIMESTAMP"]=float64(0)
//csvOp.Comma =","
fmt.Println(csvOp)
ratingDf, err := imports.LoadFromCSV(ctx, file,csvOp)

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

csvOp.DictateDataType[fieldname ] = fieldvalueInit, I just want to know the running example ,I dont know if I write the correct code style

from dataframe-go.

pjebs avatar pjebs commented on May 15, 2024

I'll write up a detailed code sample tomr

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

thx you much

from dataframe-go.

pjebs avatar pjebs commented on May 15, 2024
opts := imports.CSVLoadOptions{
	Comma: ',',
	DictateDataType: map[string]interface{}{
		"UserID": float64(0),
		"MovieID": float64(0),
	},
}

from dataframe-go.

mullerhai avatar mullerhai commented on May 15, 2024

all perfectly running

from dataframe-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.