Ignore character while importing with pandas

前端 未结 4 1206
刺人心
刺人心 2021-01-16 19:52

I could not find such an option in the documentation. A measuring device spits out everything in Excel:

    <>         


        
4条回答
  •  别那么骄傲
    2021-01-16 20:43

    Pandas read_csv() supports regex. You can avoid matching the white space if it is preceded by something (in your case #). Just as an example, avoiding "!":

    sep='(?

    if you want you could rename the column to remove the initial character and white space.

    cheers

提交回复
热议问题