- Learning pandas(Second Edition)
- Michael Heydt
- 246字
- 2021-07-02 20:37:08
Representing Univariate Data with the Series
The Series is the primary building block of pandas. It represents a one-dimensional array-like set of values of a single data type. It is often used to model zero or more measurements of a single variable. While it can appear like an array, a Series has an associated index that can be used to perform very efficient retrievals of values based upon labels.
A Series also performs automatic alignment of data between itself and other pandas objects. Alignment is a core feature of pandas where data is multiple pandas objects that are matched by label value before any operation is performed. This allows the simple application of operations without needing to explicitly code joins.
In this chapter, we will examine how to model measurements of a variable using a Series, including using an index to retrieve samples. This examination will include overviews of several patterns involved in index labeling, slicing and querying data, alignment, and re-indexing data.
Specifically, in this chapter we will cover the following topics:
- Creating a series using Python lists, dictionaries, NumPy functions, and scalar values
- Accessing the index and values properties of the Series
- Determining the size and shape of a Series object
- Specifying an index at the time of Series creation
- Using heads, tails, and takes to access values
- Value lookup by index label and position
- Slicing and common slicing patterns
- Alignment via index labels
- Performing Boolean selection
- Re-indexing a Series
- In-place modification of values
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- SpringMVC+MyBatis快速開發與項目實戰
- 算法基礎:打開程序設計之門
- Python數據挖掘與機器學習實戰
- C語言實驗指導及習題解析
- Apache Spark 2.x for Java Developers
- Building Android UIs with Custom Views
- 編程與類型系統
- Swift 4從零到精通iOS開發
- ScratchJr趣味編程動手玩:讓孩子用編程講故事
- Flink核心技術:源碼剖析與特性開發
- R語言實戰(第2版)
- Getting Started with Web Components
- Java Web 從入門到項目實踐(超值版)
- Java EE互聯網輕量級框架整合開發:SSM+Redis+Spring微服務(上下冊)