001、 读取数据,并显示数据的维度
[root@PC1 test]# ls a.out test.py [root@PC1 test]# cat a.out ## 测试数据 id pos gpos p1 ihh1 . 7111 0.007111 0.139456 0.00604659 . 7148 0.007148 0.146259 0.00731674 . 7174 0.007174 0.0578231 0.00910391 . 8957 0.008957 0.0408163 0.0100898 . 9009 0.009009 0.0340136 0.0103555 . 9011 0.009011 0.0510204 0.01051 . 9013 0.009013 0.047619 0.0105104 . 9021 0.009021 0.047619 0.0105104 . 9026 0.009026 0.0578231 0.0104484 . 9034 0.009034 0.0442177 0.0107721 [root@PC1 test]# cat test.py ## 测试程序 #!/usr/bin/env python # -*- coding:utf-8 -*-import pandas as pd ## 导入pandas模块库dat = pd.read_csv("a.out", sep = "\t") ## 读取数据print(dat.shape) ## 输出数据维度 [root@PC1 test]# python test.py ## 执行程序 (10, 5) [root@PC1 test]# wc -l a.out 11 a.out
002、c