Skip to content

Commit 1508ef4

Browse files
committed
...
1 parent 223d2c2 commit 1508ef4

File tree

1 file changed

+10
-73
lines changed

1 file changed

+10
-73
lines changed

en/content/2021/04/python-dict/python-dict.ipynb

Lines changed: 10 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"- Category: Computer Science\n",
1111
"- Tags: programming, Python, dict, data structure, mapping, hash table, dictionary\n",
1212
"- Author: Ben Du\n",
13-
"- Modified: 2021-03-19 17:52:06\n"
13+
"- Modified: 2025-06-03 20:33:03\n"
1414
]
1515
},
1616
{
@@ -34,75 +34,7 @@
3434
" \n",
3535
" This is also a good trick to yield reproducible dedupped results \n",
3636
" 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+
" "
10638
]
10739
},
10840
{
@@ -1279,10 +1211,15 @@
12791211
"source": [
12801212
"## References\n",
12811213
"\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",
12831215
"\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"
12851217
]
1218+
},
1219+
{
1220+
"cell_type": "markdown",
1221+
"metadata": {},
1222+
"source": []
12861223
}
12871224
],
12881225
"metadata": {
@@ -1306,4 +1243,4 @@
13061243
},
13071244
"nbformat": 4,
13081245
"nbformat_minor": 4
1309-
}
1246+
}

0 commit comments

Comments
 (0)