Ignore character while importing with pandas

前端 未结 4 1276
刺人心
刺人心 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:26

    Another option would be:

    f = open(fname, 'r')
    line1 = f.readline()
    data1 = pd.read_csv(f, sep='\s+', names=line1.replace(' #', '').split(), dtype=np.float)
    

    You might have a different separator though.

提交回复
热议问题