Give column name when read csv file pandas

前端 未结 4 1257
你的背包
你的背包 2021-01-30 19:39

This is the example of my dataset.

>>> user1 = pd.read_csv(\'dataset/1.csv\')
>>> print(user1)
          0  0.69464   3.1735   7.5048
0  0.0306         


        
4条回答
  •  星月不相逢
    2021-01-30 20:21

    I'd do it like this:

    colnames=['TIME', 'X', 'Y', 'Z'] 
    user1 = pd.read_csv('dataset/1.csv', names=colnames, header=None)
    

提交回复
热议问题