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
属性,它返回内部数据的形状
学员评价