私の処理の一部をRからPythonに移行しようとしています。 Rでは、私はread.table()を使って本当に面倒なCSVファイルを読んでいます。そして、正しいフォーマットでレコードを自動的に分割します。例えば。PythonでRのread.tableに相当する
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"
は正しく4つの列に分割されます。 1のレコードは多くの行に分かれていて、カンマが全部ある。 Rで私は次のようにします。
read.table(infile, header = FALSE, nrows=chunksize, sep=",", stringsAsFactors=FALSE)
これを同様にうまくいくものがありますか?
ありがとうございます!
しかしこれは文字列を返します。 read.tableが行うのと同じ方法で各列の型を推論するわけではありません。 –