処理作業の一部を R から Python に移行しようとしています。R では、read.table() を使用して非常に乱雑な CSV ファイルを読み取り、レコードを正しい形式で自動的に分割します。例えば
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 つのレコードを複数の行に分割することができ、あちこちにカンマがあります。RI では次のようにします。
read.table(infile, header = FALSE, nrows=chunksize, sep=",", stringsAsFactors=FALSE)
これを同様にうまく行うことができるPythonの何かがありますか?
ありがとう!