转自:https://blog.csdn.net/qq_21840201/article/details/80725433 ### 随机生DataFrame 类型数据import pandas as pdimport numpy as npframe = pd.DataFrame(np.random.rand(4,4),index=list('abcd'),columns=list('ABCD'))frame A B C Da 0.560094 0.352686 0.954100 0.9262
loc: only work on indexiloc: work on positionix: You can get data from dataframe without it being in the indexat: get scalar values. It's a very fast lociat: Get scalar values. It's a very fast iloc
pandas中df.ix, df.loc, df.iloc 的使用场景以及区别: https://stackoverflow.com/questions/31593201/pandas-iloc-vs-ix-vs-loc-explanation # Note: in pandas version 0.20.0 and above, ix is deprecated and the use of loc and iloc is encouraged instead. # First, a reca