官术网_书友最值得收藏!

The .index and .values properties

Each Series object consists of a series of values and an index. The values can be accessed through the .values property:

The result from is a NumPy array object, as the following verifies:

This is called out for informational purposes. We will not examine NumPy arrays in this book. Historically, pandas did use NumPy arrays under the covers, so NumPy arrays were more important in the past, but this dependency has been removed in recent versions. But as a convenience, .values returns a NumPy array even if the underlying representation is not a NumPy array.

In addition, the index for the series can be retrieved using .index:

The type of index created by pandas is RangeIndex. This is a change in pandas from the previous version of this book, when this type of index did not exist. The RangeIndex object represents a range of values from the start to the stop value with the specified step. This is efficient for pandas, compared to the previously utilized Int64Index.

The RangeIndex is simply one type of the indexes that we will explore (much of the detail in is Chapter 6, Indexing Data).
主站蜘蛛池模板: 南澳县| 翁源县| 德惠市| 扎鲁特旗| 南和县| 蓝山县| 开原市| 益阳市| 临西县| 邵东县| 黄大仙区| 罗定市| 晴隆县| 蒙城县| 屏山县| 太原市| 清镇市| 中阳县| 济宁市| 香港| 华坪县| 临江市| 锡林郭勒盟| 建平县| 深水埗区| 嵊泗县| 西林县| 冕宁县| 和平县| 三明市| 河北省| 安义县| 尼玛县| 安多县| 安庆市| 苏尼特左旗| 克什克腾旗| 鸡泽县| 弥勒县| 铜陵市| 海丰县|