Skip to content

Commit 53da872

Browse files
committed
update to python3
1 parent 28e56bb commit 53da872

5 files changed

Lines changed: 499 additions & 773 deletions

File tree

02-python-essentials/02.02-python-data-types.ipynb

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -51,58 +51,6 @@
5151
"| Pandas类型| `DataFrame, Series` |\n",
5252
"| Numpy数组 | `array([1, 2, 3])`|"
5353
]
54-
},
55-
{
56-
"cell_type": "markdown",
57-
"metadata": {},
58-
"source": [
59-
"## Number(数字)"
60-
]
61-
},
62-
{
63-
"cell_type": "markdown",
64-
"metadata": {},
65-
"source": [
66-
"Python3 支持 int、float、bool、complex(复数)。\n",
67-
"在Python 3里,只有一种整数类型 int,表示为长整型,没有 python2 中的 Long。\n",
68-
"像大多数语言一样,数值类型的赋值和计算都是很直观的。\n",
69-
"内置的 type() 函数可以用来查询变量所指的对象类型。"
70-
]
71-
},
72-
{
73-
"cell_type": "code",
74-
"execution_count": 3,
75-
"metadata": {},
76-
"outputs": [
77-
{
78-
"data": {
79-
"text/plain": [
80-
"(int, float, bool, complex)"
81-
]
82-
},
83-
"execution_count": 3,
84-
"metadata": {},
85-
"output_type": "execute_result"
86-
}
87-
],
88-
"source": [
89-
"a, b, c, d = 20, 5.5, True, 4+3j\n",
90-
"type(a), type(b), type(c), type(d)"
91-
]
92-
},
93-
{
94-
"cell_type": "markdown",
95-
"metadata": {},
96-
"source": [
97-
"*注意:在 Python2 中是没有布尔型的,它用数字 0 表示 False,用 1 表示 True。到 Python3 中,把 True 和 False 定义成关键字了,但它们的值还是 1 和 0,它们可以和数字相加*"
98-
]
99-
},
100-
{
101-
"cell_type": "code",
102-
"execution_count": null,
103-
"metadata": {},
104-
"outputs": [],
105-
"source": []
10654
}
10755
],
10856
"metadata": {
@@ -126,4 +74,4 @@
12674
},
12775
"nbformat": 4,
12876
"nbformat_minor": 1
129-
}
77+
}

0 commit comments

Comments
 (0)