- 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
- ASP.NET Core:Cloud-ready,Enterprise Web Application Development
- Python概率統(tǒng)計(jì)
- 自己動(dòng)手實(shí)現(xiàn)Lua:虛擬機(jī)、編譯器和標(biāo)準(zhǔn)庫(kù)
- 技術(shù)領(lǐng)導(dǎo)力:程序員如何才能帶團(tuán)隊(duì)
- oreilly精品圖書:軟件開發(fā)者路線圖叢書(共8冊(cè))
- Python進(jìn)階編程:編寫更高效、優(yōu)雅的Python代碼
- Web全棧工程師的自我修養(yǎng)
- 21天學(xué)通C++(第6版)
- STM32F0實(shí)戰(zhàn):基于HAL庫(kù)開發(fā)
- Linux Device Drivers Development
- C++反匯編與逆向分析技術(shù)揭秘(第2版)
- C#網(wǎng)絡(luò)編程高級(jí)篇之網(wǎng)頁(yè)游戲輔助程序設(shè)計(jì)
- 零基礎(chǔ)入門Python數(shù)據(jù)分析與機(jī)器學(xué)習(xí)
- Real Time Analytics with SAP HANA
- Learn C# in 7 days