- 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
- 摩登創(chuàng)客:與智能手機和平板電腦共舞
- PostgreSQL Cookbook
- Mastering Ember.js
- INSTANT OpenNMS Starter
- Python深度學(xué)習(xí)原理、算法與案例
- Python全棧數(shù)據(jù)工程師養(yǎng)成攻略(視頻講解版)
- 新一代SDN:VMware NSX 網(wǎng)絡(luò)原理與實踐
- C++ Application Development with Code:Blocks
- Python預(yù)測分析實戰(zhàn)
- Applied Deep Learning with Python
- jQuery Mobile Web Development Essentials(Second Edition)
- R語言數(shù)據(jù)分析從入門到實戰(zhàn)
- jQuery Essentials
- 人件集:人性化的軟件開發(fā)
- jQuery基礎(chǔ)教程(第4版)