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

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).
主站蜘蛛池模板: 玛纳斯县| 广汉市| 神农架林区| 靖州| 哈尔滨市| 新安县| 若尔盖县| 陕西省| 蒲城县| 连南| 宁武县| 墨脱县| 沅陵县| 濮阳市| 河池市| 河间市| 云林县| 古丈县| 新源县| 金阳县| 莒南县| 浮山县| 滦平县| 永德县| 高唐县| 延川县| 巨野县| 玉龙| 汕尾市| 高阳县| 公主岭市| 文安县| 桂阳县| 江城| 济阳县| 伊金霍洛旗| 浑源县| 古丈县| 屏东市| 安吉县| 琼海市|