Pycharm中从外部读取文件路径(3种方法)
绝对路径1import pandas as pdimport numpy as nppath = 'C:\\Users\\pxf\\Desktop\\train.tsv'data = pd.read_csv(path,header=None,names=['类别','特征'])2.绝对路径2import pandas as pdimport numpy as nppath = 'C:/Users/
·
- 绝对路径1
import pandas as pd
import numpy as np
path = 'C:\\Users\\pxf\\Desktop\\train.tsv'
data = pd.read_csv(path,header=None,names=['类别','特征'])
2.绝对路径2
import pandas as pd
import numpy as np
path = 'C:/Users/pxf/Desktop/train.tsv'
data = pd.read_csv(path,header=None,names=['类别','特征'])
.tsv文件使用pycharm自带的plugins就可以打开
txt文件也是一样的读取方法
3.相对路径的方式,如图:
更多推荐
已为社区贡献1条内容
所有评论(0)