python pandas read_csv quotechar does not work

后端 未结 2 1057
借酒劲吻你
借酒劲吻你 2020-12-18 06:21

I\'ve read this, this and this posts but despite I don\'t know why quotechar does not work at pd.read_csv() (Python 3, pandas 0.18.0 and 0.18.1). A

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-18 07:15

    Pandas doc on separators in read_csv():

    Separators longer than 1 character and different from '\s+' will be interpreted as regular expressions, will force use of the python parsing engine and will ignore quotes in the data.

    Try using this instead (sep by default set to a comma):

    pd.read_csv(file, skipinitialspace = True, quotechar = '"')
    

提交回复
热议问题