- Mastering Python
- Rick van Hattem
- 159字
- 2021-07-16 11:10:33
Chapter 3. Containers and Collections – Storing Data the Right Way
Python comes bundled with several very useful collections, a few of which are basic Python collection data types. The rest are advanced combinations of these types. In this chapter, we will explain some of these collections, how to use them, and the pros and cons of each of them.
Before we can properly discuss data structures and the related performance, a basic understanding of time complexity (and specifically the big O notation) is required. No need to worry! The concept is really simple, but without it, we cannot easily explain the performance characteristics of operations.
Once the big O notation is clear, we will discuss the basic data structures:
list
dict
set
tuple
Building on the basic data structures, we will continue with more advanced collections, such as the following:
- Dictionary-like types:
ChainMap
Counter
Defaultdict
OrderedDict
- List types:
Deque
Heapq
- Tuple types:
NamedTuple
- Other types:
Enum
- Python概率統計
- LabVIEW Graphical Programming Cookbook
- 劍指JVM:虛擬機實踐與性能調優
- Learning RabbitMQ
- Unity 5 for Android Essentials
- C語言程序設計
- Visual Basic程序設計
- Swift 4從零到精通iOS開發
- C指針原理揭秘:基于底層實現機制
- Android系統下Java編程詳解
- Learning Grunt
- 大規模語言模型開發基礎與實踐
- C# 7.1 and .NET Core 2.0:Modern Cross-Platform Development(Third Edition)
- Design Patterns and Best Practices in Java
- 循序漸進Vue.js 3前端開發實戰