ch02: created notebook
This commit is contained in:
parent
0e53341809
commit
b1fbf30f0d
@ -6,7 +6,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# Chapter 1 — The Python Data Model\n",
|
"# Chapter 1 — The Python Data Model\n",
|
||||||
"\n",
|
"\n",
|
||||||
"**Sections with examples:**\n",
|
"**Sections code snippets in this chapter:**\n",
|
||||||
"\n",
|
"\n",
|
||||||
"* [A Pythonic Card Deck](#A-Pythonic-Card-Deck)\n",
|
"* [A Pythonic Card Deck](#A-Pythonic-Card-Deck)\n",
|
||||||
"* [Emulating Numeric Types](#Emulating-Numeric-Types)"
|
"* [Emulating Numeric Types](#Emulating-Numeric-Types)"
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"### Example 1-1. A deck as a sequence of playing cards"
|
"#### Example 1-1. A deck as a sequence of playing cards"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -140,7 +140,7 @@
|
|||||||
{
|
{
|
||||||
"data": {
|
"data": {
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"Card(rank='2', suit='hearts')"
|
"Card(rank='Q', suit='clubs')"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 6,
|
"execution_count": 6,
|
||||||
@ -463,7 +463,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"### Example 1-2. A simple two-dimensional vector class"
|
"#### Example 1-2. A simple two-dimensional vector class"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
3
02-array-seq/.gitignore
vendored
Normal file
3
02-array-seq/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
floats-*.txt
|
||||||
|
floats-*.npy
|
||||||
|
floats.bin
|
2203
02-array-seq/array-seq.ipynb
Normal file
2203
02-array-seq/array-seq.ipynb
Normal file
File diff suppressed because it is too large
Load Diff
11
02-array-seq/slice-assign.rst
Normal file
11
02-array-seq/slice-assign.rst
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Assigning to Slices
|
||||||
|
===================
|
||||||
|
|
||||||
|
An example that raises an error::
|
||||||
|
|
||||||
|
>>> l = list(range(10))
|
||||||
|
>>> l[2:5] = 100
|
||||||
|
Traceback (most recent call last):
|
||||||
|
...
|
||||||
|
TypeError: can only assign an iterable
|
||||||
|
|
Loading…
Reference in New Issue
Block a user