import numpy as np
import pandas as pd
data=pd.DataFrame(np.arange(16).reshape(4,4),index=['ohio','Colorado','Utah','NewYork'],columns=['one','two','three','four'])
针对DataFrame标签索引的loc和iloc方法:import numpy as npimport pandas as pddata=pd.DataFrame(np.arange(16).reshape(4,4),index=['ohio','Colorado','Utah','NewYork'],columns=['one','two','three','four'])建立“data”作为基础数据lociloc行名称标签整数标签data.loc[‘Utah’]