What does print(… sep='', '\t' ) mean?

前端 未结 4 2030
逝去的感伤
逝去的感伤 2020-12-08 11:06

I am having a bit of trouble trying to find an answer to this. I would like to know what the syntax sep=\"\" and \\t means. I have found some infor

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-08 11:58

    The sep='\t' can be use in many forms, for example if you want to read tab separated value: Example: I have a dataset tsv = tab separated value NOT comma separated value df = pd.read_csv('gapminder.tsv'). when you try to read this, it will give you an error because you have tab separated value not csv. so you need to give read csv a different parameter called sep='\t'.

    Now you can read: df = pd.read_csv('gapminder.tsv, sep='\t'), with this you can read the it.

提交回复
热议问题