6分钟
Seris
Seris的结构如图所示(实线为普通属性,虚线为property属性或者getset_descriptor):
._name为普通属性,返回Seris的名字;.name为property属性,返回的也是Seris名字
.dtype/.dtypes为property属性,返回Series的数据类型。
.ftype/ftypes为property属性,返回一个字符串,说明Series是否稀疏数据。(二者返回的字符串的值相同,但不是同一个字符串对象)
.values/._values为property属性,返回Series的内部数据的视图
.index为普通属性,返回Series的索引
.shape为property属性,返回Series的数据的形状
._data为普通属性,它返回的是一个SingleBlockManager对象,该对象负责管理内部数据。
SingleBlockManager的.shape属性为property属性,返回内部数据的形状
SingleBlockManager的.blocks属性为普通属性,返回一个列表,该列表只有一个元素,该元素为一个IntBlock对象(或者其他的xxxBlock对象),代表了内部数据。
IntBlock的.values属性为普通属性,它返回内部数据:一个ndarray。
IntBlock的.shape属性为property属性,它返回内部数据的形状
学员评价