loc,iloc,ix三者间的区别和联系 loc .loc is primarily label based, but may also be used with a boolean array. 就是说,loc方法主要是用label来选择数据的.1 A single label, e.g. 5 or 'a', (note that 5 is interpreted as a label of the index. This use is not an integer position alon…
约定: import numpy as np import pandas as pd 1 2 3 一.CSV数据的导入和保存 csv数据一般格式为逗号分隔,可在excel中打开展示. 示例 data1.csv: A,B,C,D 1,2,3,a 4,5,6,b 7,8,9,c 1 2 3 4 5 代码示例: # 当列索引存在时 x = pd.read_csv("data1.csv") print x ''' A B C D 0 1 2 3 a 1 4 5 6 b 2 7 8 9 c ''…
一:读取数据的函数 1.读取csv文件 import numpy as np import pandas as pd data = pd.read_csv("C:\\Users\\Administrator\\Desktop\\result.csv",encoding="utf-8") # 这里需要注意路径必须用\\斜杠,\斜杠显示语法错误. data # 结果 数据量共100多万条,中间的省略显示…