用pandas读取csv文件,并删除包含NaN的数值行,计算df列的length
Sn78-2-d - 副本.CSV
查看代码
"TIME","LATITUDE","LONGITUDE","TYPE","NR-TAC","NR-PCI","NR-CI","NR-ARFCN","CSI-RSRP","CSI-RSRQ","CSI-SINR","SS-RSRP","SS-RSRQ","SS-SINR","TAC","PCI","ECI","EARFCN","BAND_WIDTH","RSSI","RSRP","RSRQ","SINR","CQI","LAC","CI","RXLEV","ARFCN","BSIC","PSC","UARFCN","NID","BID","SID","CDMADBM","CDMAECIO","EVDODBM","EVDOECIO","EVDOSNR"
"20220323 18:42:07.606","","","NONE","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""
"20220323 18:42:07.681","","","NONE","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""
"20220323 18:42:07.697","","","NR","","","","","","","","","","","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.698","","","NR","","","","","","","","","","","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.698","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.704","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.707","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.709","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.709","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.725","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.729","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.730","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.731","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.736","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.740","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.742","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:07.743","","","NR","","","","","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:08.617","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:09.759","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:10.359","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:10.363","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:10.859","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:11.332","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:11.909","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:12.936","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:13.364","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:13.371","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:13.982","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:15.030","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:15.386","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:16.082","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:16.354","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:16.357","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:17.132","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:18.219","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:19.254","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:19.368","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:19.372","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:19.516","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:20.300","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:21.385","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:22.412","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:22.436","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:22.519","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:22.545","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:23.590","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:24.676","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:25.585","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:25.754","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:26.841","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:27.926","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:28.396","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:28.405","","","NR","1","61","20217857","630720","","","","-111","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:29.017","","","NR","1","61","20217857","630720","","","","-111","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:30.069","","","NR","1","61","20217857","630720","","","","-111","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:31.191","","","NR","1","61","20217857","630720","","","","-111","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:32.278","","","NR","1","61","20217857","630720","","","","-111","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:33.356","","","NR","1","61","20217857","630720","","","","-111","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:34.024","","","NR","1","61","20217857","630720","","","","-111","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:34.424","","","NR","1","61","20217857","630720","","","","-111","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:34.435","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:34.442","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:35.545","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:36.622","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:37.064","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:37.386","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:37.390","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:37.729","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:38.789","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:39.866","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:40.925","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:41.455","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:42.007","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:43.066","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:43.382","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:43.387","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:44.160","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:44.501","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:45.239","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:46.313","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:47.354","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:47.528","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:48.409","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:49.485","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:50.551","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:51.223","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:51.611","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:52.668","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:53.713","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:54.263","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:54.763","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:55.824","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:56.858","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:57.903","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:58.954","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:42:59.529","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:00.028","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:01.096","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:01.403","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:01.410","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:02.152","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:02.548","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:03.222","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:04.299","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:04.395","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:04.399","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:05.368","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:05.577","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:06.414","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:07.419","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:07.426","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:07.489","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:08.529","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:09.587","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:10.614","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:11.230","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:11.756","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:12.822","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:13.911","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:14.252","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:14.959","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:16.060","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:17.110","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:17.296","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:18.175","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:19.246","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:19.409","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:19.414","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:20.314","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:20.329","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:21.352","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:22.406","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:23.343","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:23.452","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:24.520","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:25.413","","","NR","1","61","20217857","630720","","","","-110","-6","12","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:25.419","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:25.620","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:26.373","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:26.671","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:27.721","","","NR","1","61","20217857","630720","","","","-110","-6","14","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:28.420","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:28.428","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:28.791","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:29.863","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:30.914","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:31.220","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:31.972","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:33.040","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:34.117","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:34.262","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:35.206","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:36.259","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:37.319","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:37.324","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:38.379","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:39.436","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:40.364","","","NR","1","61","20217857","630720","","","","-110","-6","13","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:40.416","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:40.422","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:40.513","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:41.608","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:42.667","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:43.403","","","NR","1","61","20217857","630720","","","","-110","-6","10","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:43.423","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:43.427","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:43.757","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
"20220323 18:43:44.804","","","NR","1","61","20217857","630720","","","","-110","-6","11","","","","","","","","","","","1","","","","","0","","","","","","","","",""
read_cellz_test.py
# -*- coding: UTF-8 -*-
# 自动读取手机应用“Cellular_Z的csv日志格式”计算rsrp平均值的脚本
import os
from statistics import mean
import pandas as pd
import re
# 给定待读取的csv文件的路径到列表里
csv_filepath = r"D:\\kang\\myproject\\read_RSRP_four_direction_csv_avg\\report\\Sn78-2-d - 副本.CSV"
# df1 = df.iloc[:, 0:4] #读取第1列到第4列数据
###1.跳过每个csv文件开头不需要的行的函数
# def skip_to(fle,**kwargs):
# if os.stat(fle).st_size == 0:
# raise ValueError("File is empty")
# with open(fle) as f:
# pos = 0
# cur_line = f.readline()
# while not cur_line.find('下行MAC总吞吐率(bps)","上行MAC总吞吐率(bps)')>=0:
# pos = f.tell()
# cur_line = f.readline()
# f.seek(pos)
# return pd.read_csv(f, **kwargs)
# 2.读取csv文件到内存
# df = skip_to(csv_filepath,encoding = 'gbk') # 读取csv用模块skip_to()
# 1、加载指定的csv文件数据列到内存,优化程序速度
df = pd.read_csv(csv_filepath,encoding = 'utf-8',usecols=[0,11,20]) #读取csv文件到内存,读取指定的[0,11,20] 列
# 2、根据实际的5G?4G?情况处理加载初始数据列
b_SS_RSRP = df['SS-RSRP'].isnull().all() # 判断SS-RSRP列是否全部为NaN
b_RSRP = df['RSRP'].isnull().all() # 判断RSRP列是否全部为NaN
if b_RSRP==True and b_SS_RSRP==False: #测试5G
df1 = df[["TIME","SS-RSRP"]]
elif b_RSRP==False and b_SS_RSRP==True: #测试4G
df1 = df[["TIME","RSRP"]]
else: #异常情况,需要打印提示
print("-----抓取cell_z缓存csv日志步骤出错,请先退出程序重试!-----")
# 3、处理含有NaN的数据行
df2 = df1.dropna(how="any")
temp = df2.index
dflen = len(temp) #求出df对象的长度
# df1.loc[[i],["SS-RSRP"]]
# 4、根据正则表达式提取
pattern_1 = r"^\d{8}.*\d{2}:\d{2}:\d{2}"
avg_index_list = []
rsrp_list = []
for i in range(dflen):
result_l = re.findall(pattern= pattern_1 , string= df2.iloc[i,0] ) # 索引值是从0开始,并且是去除了NaN的那个df对象,从新开始数的
avg_index_list.append( result_l[0] )
rsrp_list.append( df2.iloc[i,1] )
# print(avg_index_list) #获得1个由时间构成的列表,相当于Excel的用,文本分列
# print(rsrp_list) #获得1个由信号强度构成的列表,相当于Excel的用,文本分列
# 5、使用zip()内置函数创建DataFrame
zip_result = zip(avg_index_list,rsrp_list)
zip_result_list = list(zip_result)
df3 = pd.DataFrame(zip_result_list,columns=["时间","数值"])
# 6、数据分组计算平均值
_df_count = df3.groupby("时间").count() #计数
_df_mean = df3.groupby("时间").mean() #平均值
_df_mean_all = _df_mean["数值"].mean() #数据透视表求Cellular_Z.apk输出日志的RSRP真实平均值
# 7、对浮点值进行小数点后7位处理化简
_df_mean_all_round = round( _df_mean_all ,7)
# print(df2)
# print(result_l)
# print(temp)
# print(dflen)
# print(b_SS_RSRP) #Flase
# print(b_RSRP) #True
# print(zip_result_list)
# print(df3)
# print(_df_mean_all) #-110.06315789473685
print(_df_mean_all_round)
部分内容来自于学习编程期间收集于网络的免费分享资源和工作后购买的付费内容。
如需获取教程配套的资源文件和一对一专属答疑支持,请加vx:kangmf24联系作者。