索引索引.loc操作可以理解为给定一个二维矩阵,并给定二维矩阵对应的索引,给定索引首先给定行名称(若第一列为index则直接指定index的值),再给定列的名称。
.iloc操作与.loc操作类似,但是更加坐标化了。直接根据给定的坐标取对应的区域,坐标从(0,0)开始。
下面给出一个.iloc的例子


更加简化对.loc的索引要求。
以及dataframe.ix:
dataframe.ix可以接受行(index)与列(column)的切片,且对.iloc和.loc均适用。给出一个例子:


索引索引.loc操作可以理解为给定一个二维矩阵,并给定二维矩阵对应的索引,给定索引首先给定行名称(若第一列为index则直接指定index的值),再给定列的名称。
.iloc操作与.loc操作类似,但是更加坐标化了。直接根据给定的坐标取对应的区域,坐标从(0,0)开始。
下面给出一个.iloc的例子
更加简化对.loc的索引要求。
以及dataframe.ix:
dataframe.ix可以接受行(index)与列(column)的切片,且对.iloc和.loc均适用。给出一个例子:
本文标题:python的pandas.DataFrame(2)
本文链接:https://www.haomeiwen.com/subject/mvzkfxtx.html
网友评论