Sto provando a spostare parte del mio lavoro di elaborazione da R a Python. In R, uso read.table() per leggere file CSV REALMENTE disordinati e divide automaticamente i record nel formato corretto. Per esempio.L'equivalente read.table di R in Python
391788,"HP Deskjet 3050 scanner always seems to break","<p>I'm running a Windows 7 64 blah blah blah........ake this work permanently?</p>
<p>Update: It might have something to do with my computer. It seems to work much better on another computer, windows 7 laptop. Not sure exactly what the deal is, but I'm still looking into it...</p>
","windows-7 printer hp"
è correttamente separato in 4 colonne. 1 record può essere suddiviso su più righe e ci sono virgole dappertutto. In R Io faccio solo:
read.table(infile, header = FALSE, nrows=chunksize, sep=",", stringsAsFactors=FALSE)
C'è qualcosa in Python che può fare questo altrettanto bene?
Grazie!
Ma questo restituisce solo stringhe. Non deduce il tipo di ciascuna colonna come fa read.table. –