10
10
" - Category: Computer Science\n " ,
11
11
" - Tags: programming, Python, dict, data structure, mapping, hash table, dictionary\n " ,
12
12
" - Author: Ben Du\n " ,
13
- " - Modified: 2021-03-19 17:52:06 \n "
13
+ " - Modified: 2025-06-03 20:33:03 \n "
14
14
]
15
15
},
16
16
{
34
34
" \n " ,
35
35
" This is also a good trick to yield reproducible dedupped results \n " ,
36
36
" without using sort.\n " ,
37
- " \n " ,
38
- " 2. With the method `dict.setdefault`, \n " ,
39
- " you do not really need `defaultdict`.\n " ,
40
- " As a matter of fact,\n " ,
41
- " it is recommended that you use `dict` over `defaultdict` for safty reasons."
42
- ]
43
- },
44
- {
45
- "cell_type" : " code" ,
46
- "execution_count" : 1 ,
47
- "metadata" : {
48
- "tags" : []
49
- },
50
- "outputs" : [],
51
- "source" : [
52
- " s = set([11111, 10, 8, 7, 1, 2, 3])"
53
- ]
54
- },
55
- {
56
- "cell_type" : " code" ,
57
- "execution_count" : 2 ,
58
- "metadata" : {
59
- "tags" : []
60
- },
61
- "outputs" : [
62
- {
63
- "data" : {
64
- "text/plain" : [
65
- " [1, 2, 3, 7, 8, 11111, 10]"
66
- ]
67
- },
68
- "execution_count" : 2 ,
69
- "metadata" : {},
70
- "output_type" : " execute_result"
71
- }
72
- ],
73
- "source" : [
74
- " list(s)"
75
- ]
76
- },
77
- {
78
- "cell_type" : " code" ,
79
- "execution_count" : 18 ,
80
- "metadata" : {
81
- "tags" : []
82
- },
83
- "outputs" : [
84
- {
85
- "data" : {
86
- "text/plain" : [
87
- " [1, 2, 3, 7, 8, 11111, 10]"
88
- ]
89
- },
90
- "execution_count" : 18 ,
91
- "metadata" : {},
92
- "output_type" : " execute_result"
93
- }
94
- ],
95
- "source" : [
96
- " list(s)"
97
- ]
98
- },
99
- {
100
- "cell_type" : " code" ,
101
- "execution_count" : 2 ,
102
- "metadata" : {},
103
- "outputs" : [],
104
- "source" : [
105
- " import numpy as np"
37
+ " "
106
38
]
107
39
},
108
40
{
1279
1211
"source" : [
1280
1212
" ## References\n " ,
1281
1213
" \n " ,
1282
- " https://docs.python.org/3/library/stdtypes.html#typesmapping\n " ,
1214
+ " - [Built-in Types]( https://docs.python.org/3/library/stdtypes.html#typesmapping) \n " ,
1283
1215
" \n " ,
1284
- " https://stackoverflow.com/questions/613183/how-do-i-sort-a-dictionary-by-value\n "
1216
+ " - [How do I sort a dictionary by value?]( https://stackoverflow.com/questions/613183/how-do-i-sort-a-dictionary-by-value) \n "
1285
1217
]
1218
+ },
1219
+ {
1220
+ "cell_type" : " markdown" ,
1221
+ "metadata" : {},
1222
+ "source" : []
1286
1223
}
1287
1224
],
1288
1225
"metadata" : {
1306
1243
},
1307
1244
"nbformat" : 4 ,
1308
1245
"nbformat_minor" : 4
1309
- }
1246
+ }
0 commit comments