《Python深度学习》书籍代码
此项目是《Python深度学习》书籍代码。
Python深度学习体系包括:导语、Python开发环境结构、Python基础、深度学习、生成对抗网络、遗传算法与神经网络、迁移学习与计算机视觉、迁移学习与自然语言处理。
想了解详情请下载附件。
应用介绍
此项目是《Python深度学习》书籍代码。
下面展示一小段代码:
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Python基础教学代码---基础篇 \n",
"1.变量赋值 \n",
"2.标准数据类型 \n",
"3.数据转换 \n",
"4.算数运算符 \n",
"5.格式化\n",
"***"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1.变量赋值"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n",
"2 2\n"
]
}
],
"source": [
"a = 1 # 单变量赋值\n",
"c = b = 2 # 多变量赋值\n",
"print(a)\n",
"print(b, c)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'str'>\n",
"<class 'float'>\n",
"<class 'int'>\n"
]
}
],
"source": [
"# 变量类型\n",
"name = 'Chile' # 字符串\n",
"miles = 1000.0 # 浮点型\n",
"num = 100 # 整形\n",
"# 打印变量类型\n",
"print(type(name))\n",
"print(type(miles))\n",
"print(type(num))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"***\n",
"## 2.标准数据类型 \n",
"\n",
"Python有6个标准的数据类型: \n",
"1.Numbers(数字) \n",
"2.String(字符串) \n",
"3.List(列表) \n",
"4.Tuple(元组) \n",
"5.Dictionary(字典) \n",
"6.Set(集合) \n",
"其中List,Tuple,Dictionary,Set可以放任意数据类型"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 数字"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# Numbers: int & float\n",
"a = 1 # int\n",
"b = 1.0 # float"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"C\n",
"hi\n",
"ile\n",
"e\n"
]
}
],
"source": [
"# String\n",
"my_name = 'Chile'\n",
"print(my_name[0]) # 打印第0个字符\n",
"print(my_name[1: 3]) # 打印第1个到第2个的字符\n",
"print(my_name[2:]) # 打印第2个到最后一个的字符\n",
"print(my_name[-1]) # 打印倒数第一个字符"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 列表"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1, 2, 3, 4]\n",
"['Chile', 'b', 'c']\n",
"['a', 1, 1.0, [1, 2, 3, 4], ['Chile', 'b', 'c']]\n"
]
}
],
"source": [
"# List 可以放任意类型的数据类型\n",
"num_list = [1, 2, 3, 4]\n",
"str_list = ['Chile', 'b', 'c']\n",
"mix_list = ['a', 1, 1.0, num_list, str_list]\n",
"print(num_list)\n",
"print(str_list)\n",
"print(mix_list)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 元组"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n",
"('chile', 111, 2.2, 'a', [1, 2, 3, 4])\n"
]
},
{
"ename": "TypeError",
"evalue": "'tuple' object does not support item assignment",
"output_type": "error",
"traceback": [
.........想了解详情请下载附件。
©版权声明:本文内容由互联网用户自发贡献,版权归原创作者所有,本站不拥有所有权,也不承担相关法律责任。如果您发现本站中有涉嫌抄袭的内容,欢迎发送邮件至: [email protected] 进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。
转载请注明出处: apollocode » 《Python深度学习》书籍代码
文件列表(部分)
名称 | 大小 | 修改日期 |
---|---|---|
3_2_Basis.ipynb | 2.41 KB | 2020-02-22 |
3_3_Basis_Advance.ipynb | 2.71 KB | 2020-02-22 |
3_4_Basis_high_ranking.ipynb | 107.58 KB | 2020-02-22 |
test.py | 0.03 KB | 2020-02-22 |
text.txt | 0.03 KB | 2020-02-22 |
tx.txt | 0.01 KB | 2020-02-22 |
4_7_1_MLP.ipynb | 21.84 KB | 2020-02-22 |
4_7_2_MLP_Text.ipynb | 236.97 KB | 2020-02-22 |
4_7_3_CNN_text.ipynb | 238.43 KB | 2020-02-22 |
4_7_4_Tradition_cnn_image.ipynb | 30.62 KB | 2020-02-22 |
4_7_5_AutoEncoder.ipynb | 178.99 KB | 2020-02-22 |
4_7_6_stock_trend_predict.ipynb | 97.52 KB | 2020-02-22 |
5_3_GAN.ipynb | 68.54 KB | 2020-02-22 |
6_1_4_EDEN.ipynb | 6.67 KB | 2020-02-22 |
xor-checkpoint.ipynb | 0.07 KB | 2020-02-22 |
avg_fitness.svg | 9.29 KB | 2020-02-22 |
config-feedforward | 0.64 KB | 2020-02-22 |
Digraph.gv | 0.36 KB | 2020-02-22 |
Digraph.gv.svg | 1.72 KB | 2020-02-22 |
neat-checkpoint-104 | 115.69 KB | 2020-02-22 |
neat-checkpoint-109 | 121.75 KB | 2020-02-22 |
neat-checkpoint-114 | 128.20 KB | 2020-02-22 |
neat-checkpoint-119 | 134.75 KB | 2020-02-22 |
neat-checkpoint-124 | 134.57 KB | 2020-02-22 |
neat-checkpoint-14 | 56.58 KB | 2020-02-22 |
neat-checkpoint-19 | 56.93 KB | 2020-02-22 |
neat-checkpoint-24 | 29.81 KB | 2020-02-22 |
neat-checkpoint-29 | 36.24 KB | 2020-02-22 |
neat-checkpoint-34 | 43.22 KB | 2020-02-22 |
neat-checkpoint-39 | 47.38 KB | 2020-02-22 |
发表评论 取消回复