- 博客(26)
- 收藏
- 关注
原创 笨办法学python45
class Animal(object): pass class Dog(Animal): def __init__(self,name): self.name = name class Cat(Animal): def __init__(self,name): self.name = name class Person(Anim...
2019-09-10 10:44:32
259
原创 笨办法学python 42
lesson 42 pycharm自动补全的变量的类别 f:function函数 p:parameter参数 m:method 方法 c:class类 v:variable 变量 class 的 格式 class XXX(object): def _init_(self): self,XXXX = XXXX def some_fuctiong(self): ...
2019-09-10 10:28:43
235
原创 matlab——简单CNN网络的数字识别
digitDatasetPath = fullfile(matlabroot,'toolbox','nnet', ... 'nndemos','nndatasets','DigitDataset'); imds = imageDatastore(digitDatasetPath, ... 'IncludeSubfolders',true, ... 'LabelSource'...
2019-09-09 10:14:00
2260
3
原创 笨办法学python 41
lesson 41 题目: cities['_find'] = find_city city_found = cities['_find'](cites, state) 正序解读,由前向后阅读代码 首先要记得一点就是函数也是可以当作变量来使用的。所以 def find_city 实际上也创建了一个可以随意调用的变量。 而第一行代码也很好理解,就是创建了一个名为 cities 的字典,为其中名字是...
2019-09-08 13:11:01
403
原创 笨办法学python 40
lesson 40 字典 列表 可以使用数字作为索引,通过数字找到列表中的元素 字典 可以通过任何东西找到元素,不止是数字。 字典可以将一个物体和另外一个物体关联。 # cities = {'CA': 'San Francisco', 'MI': 'Detroit', 'FL': 'Jacksonville','NY':'New York','OR':'Portland'} cities = {'...
2019-09-06 20:46:06
181
原创 笨办法学py 38-39
lesson 阅读代码 然后通读你打印出来的代码并做好标记,标记的内容包括以下几个方面: 1,函数以及函数的功能。 2,每个变量的初始赋值。 3,每个在程序的各个部分中多次出现的变量。它们以后可能会给你带来麻烦。 4,任何不包含else的if语句。它们是正确的吗? 5、任何可能没有结束点的while循环。 6,最后一条,代码中任何你看不懂的部分都记下来。 lesson 39 ten_things ...
2019-09-06 19:19:20
137
原创 笨办法学py 36
lesson 36 最好的调试程序的方法是使用print在各个你想要检查的关键环节将关键变量打印出来,从而检查哪里是否有错。 让程序一部分一部分地运行起来。不要等一个很长的脚本写完后才去运行它。写一点,运行一点,再修改一点。 最好使用 for循环 较少使用while 循环 from sys import exit def start(): print("我们来玩一个游戏吧") ...
2019-09-06 17:24:05
243
原创 笨办法学python 34
lesson 34 访问列表的元素 索引定义 关于序数(ordinal number)和基数(cardinal number)的知识 例如: 基数:一、二、三、四、五、六、七、八、九、十。 序数:第一、第二、第三、第四、第五、第六、第七、第八、第九、第十。 基数: 在数学上,基数(cardinal number)是集合论中刻画任意集合大小的一个概念。两个能够建立元素间一一对应的集合称为...
2019-09-06 16:45:49
273
原创 笨方法学python 33
lesson 33 while 循环 while-loop.、(while循环)。 while-loop会一直执行它下面的代码片段,直到它对应的布尔表达式为False时才会停下来。 等等,你还能跟得上这些术语吧?如果你的某一行是以:(冒号,colon)结尾,那就意味着接下来的内容是一个新的代码片段,新的代码片段是需要被缩进的。 只有将代码用这样的方式格式化,Python才能知道你的目的。 回到wh...
2019-09-06 14:39:35
160
原创 本办法学python 32
for 循环 theCount = [1, 2, 3, 4, 5] fruits = ['apples', 'oranges', 'pears', 'apricots'] change = [1, 'pennies', 2, 'dimes', 3, 'quarters'] # this first kind of for-loop goes through a list for number in...
2019-09-06 14:07:27
130
原创 笨办法学python 29-31
lesson 29 Else和If people = 30 cars = 40 buses = 15 if cars > people: print("we should take the cars.") elif cars <people: print("we should not take the cars.") else: print("we can't...
2019-09-06 13:01:24
158
原创 笨办法学python 29
if 知识点 people = 20 cats = 30 dogs = 15 if people < cats: print("too many cats , the world is doomed") if people>cats: print("not many cats! the world is saved") if people <dogs: ...
2019-09-06 11:20:12
165
原创 笨方法学python27
lesson 27 记住逻辑关系 and——与 or——或 not——非 !=(not equal)——不等于 ==(equal)——等于 >=(greater-than-equal)——大于等于 <=(less-than-equal)——小于等于 True——真 False——假 lesson28 print("True and True:", True and True) pri...
2019-09-06 10:54:12
115
原创 笨方法学python26
def break_words(stuff): """This function will break up words for us.""" words = stuff.split(' ') return words def sort_words(words): """Sorts the words.""" return sorted(words)...
2019-09-06 10:31:56
220
原创 笨方法学python 25
def break_words(stuff): """This function will break up words for us.""" words = stuff.split(' ') return words def sort_words(words): """Sorts the words.""" return sorted(words) ...
2019-09-05 11:54:18
460
原创 笨方法学python 24
#24 lession print("Let's practice everything.") print('you\'d need to know\'bout escapes with \\ that do \n newlines and \t tabs') poem=""" \t the lovely world with logic so firmly planted cannot d...
2019-09-05 11:16:33
155
原创 笨方法学python 22
Python程序区分大小写 print 打印中 \表示的字符就是 包含‘’时用’’ Python用r’‘表示’'内部的字符串默认不转义,即‘’ 前加r / 除法,结果为浮点数 10/3 = 一系列小数 // 地板除,结果为整数 10//3 = 3 % 除法取余数 10%3 = 1 print("\\n") print("I\'m \"OK\"!") print(r"\\\\\\") 列表 [...
2019-09-05 10:38:06
194
原创 笨方法学python 21
#21 lession def add(a, b): print("ADDING %d+%d" % (a, b)) return a + b def subtract(a, b): print("SUBTRACTING %d-%d" % (a, b)) return a - b def multiply(a, b): print("MULTIPLY...
2019-09-05 10:03:32
162
原创 人工智能实践:Tensorflow笔记——张量、计算图、会话
输出为 Tensor("add:0", shape=(2, ), dtype-float32) 计算图只描述计算过程,不计算运算结果 运算需要会话(Session)
2019-09-04 17:31:00
224
原创 python基础知识 类、对象、面向对象
类对象 面向对象 类:物以类聚人以群分,是函数的集合,可实例化出对象的模具。 实例化:对象=类();t=turtle.Pen0) 对象:是类实例化出的实体,对象实实在在存在,完成具体工作。 面向对象:程序员反复修改优化类,类实例化出对象,对象调用类里的函数执行具体的操作。 ...
2019-09-04 16:44:22
116
原创 笨方法学python18-20
# 习题 18:命名、变量、代码、函数 # 知识点总结: # 一、函数可以给代码片段命名,就跟变量和数字命名一样 # 二、它们可以接受参数,就跟你的脚本接受argv一样。 # 三、通过使用#1和#2,它们可以让你创建微型脚本或者小命令。 # this one is like your scripts with argv # 用def定义函数print_two,参数为*args def print...
2019-09-04 10:28:39
207
原创 python 一些命令概念
列表名 [起:止] 表示切片,从列表中切出相应的元素前闭后开 c[ 0 :2]切出[1,2] c[ : ]切出[1,2,3,4,5,6,7] 列表名[起:止:步长]带步长的切片,步长有方向。 c=[1,2,3,4,5,6,7] 切出[5, 4,3, 2]用c[4:0:-1] 切出[5,4,3,2,1],用c[4::-1] 切出[6,4,2]用c[-2::-2]从倒数第二个开始一直且到头,步长-2...
2019-09-03 20:00:22
125
原创 tensorflow 学习1
TensorFlow 运行方法 import tensorflow as tf m1 = tf.constant([[2, 2]]) m2 = tf.constant([[3], [3]]) dot_operation = tf.matmul(m1, m2) print(dot_operation) # wrong! no result # method...
2019-09-03 16:28:46
171
转载 几篇不错的文章
神经网络模型之AlexNet的一些总结:https://www.cnblogs.com/gongxijun/p/6027747.html Alexnet网络结构讲解:https://blog.csdn.net/weixin_34232363/article/details/86978883 经典网络架构(二):AlexNet:https://blog.csdn.net/chenyuping333/...
2019-07-30 23:10:00
111
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅