Give column name when read csv file pandas

前端 未结 4 1244
你的背包
你的背包 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:32

    we can do it with a single line of code.

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

提交回复
热议问题