PYTHON
文章平均质量分 65
AndesStay
行到水穷处,坐看云起时。
展开
-
学习DDPG算法倒立摆程序遇到的函数
1.np.random.seed点击打开链接2.tf.set_random_seed(1)点击打开链接应该和1类似,产生图级的随机序列。那1就是产生操作级的随机序列吧。3.dict(name = 'soft', tau = 0.01) python中的结构形式,create empty dictionary4.tf.variable_scope点击打开链接点击打开链接用来管理相同环境中的同名变量。...原创 2018-07-12 19:17:32 · 3328 阅读 · 1 评论 -
python习题练习(三)
参考书籍:python程序设计chapter51.def main(): print("This pro converts the date.") #input date = input("Please input the date (mm/dd/yyyy):") #split into components month, day, yea...原创 2019-01-03 22:32:35 · 263 阅读 · 0 评论 -
python习题练习(一)
参考书籍:python程序设计chapter 15.print("This program illustrates a chaotic function")x = eval(input("Enter a number between 0 and 1:"))n = eval(input("How many times shoule I print?"))for i in rang...原创 2019-01-02 22:21:04 · 525 阅读 · 0 评论 -
python习题练习(二)
参考书籍:python程序设计chapter41.from graphics import *def main(): win = GraphWin() shape = Rectangle(Point(10,10), Point(20, 20)) shape.setOutline('green') shape.setFill('blue') ...原创 2019-01-02 22:24:51 · 242 阅读 · 0 评论 -
python习题练习(四)
参考书籍:python程序设计chapter6.test#happy2.py#This pro is a exercise in the book.def happy(): return "Happy Birthday to you!\n"def verseFor(person): lyrics = happy() * 2 + "Happy birthday,...原创 2019-01-07 21:21:05 · 390 阅读 · 0 评论 -
python习题练习(八)
参考书籍:python程序设计chapter10.3.#This pro let user choose a button and show the result(right or wrong).from button import Buttonfrom graphics import *from random import randrangedef drawWin():...原创 2019-01-18 21:14:57 · 735 阅读 · 0 评论 -
python习题练习(五)
参考书籍:python程序设计chapter75.#This pro print the healthy level based on the BMI.#input:weight(kg), and height(cm).#output:healthy leveldef ConvertWeight(weight): #This pro convert weight kg...原创 2019-01-08 22:44:40 · 558 阅读 · 0 评论 -
python习题练习(六)
参考书籍:python程序设计chapter8.testfrom graphics import *def handlekey(k, win): if k == "r": win.setBackground("pink") if k == "w": win.setBackground("white") if k == "g"...原创 2019-01-14 20:52:42 · 535 阅读 · 0 评论 -
python习题练习(七)
参考书籍:python程序设计chapter91.from random import randomdef main(): printIntro() probA, probB, n = getInputs() winsA, winsB = simNGames(n, probA, probB) printSummary(winsA, winsB)...原创 2019-01-16 22:36:33 · 875 阅读 · 0 评论 -
python绘图基础
参考网页https://blog.csdn.net/anneqiqi/article/details/64125186https://blog.csdn.net/helunqu2017/article/details/78614640https://zhidao.baidu.com/question/942252736312635572.html?qbl=relate_question...原创 2018-12-17 12:01:10 · 394 阅读 · 0 评论 -
python基础学习笔记(一)——数据类型stdtypes和列表list
机器之心整理参考python官方说明chaper3 数字和字符串数字:分为int和float,可以相互转换。注意:在int型数字计算平均值的过程中,无论计算结果是整数还是浮点数,结果都为float型。关于布尔型字符串计算字符串长度的函数len()s='abc'a=len(s)print(a)str.capitalize()函数,返回的字符串首字母大...原创 2018-09-07 17:48:16 · 480 阅读 · 0 评论 -
学习DDPG机械手臂算法笔记
1.关于pyglet点击打开链接 一个实时刷新的做动画模块 pyglet.gl.glClearColor(1, 1, 1, 1) 窗口背景颜色 self.batch=pyglet.graphics.Batch()点击打开链接 pyglet.graphics.Batch()用于产生一个图形的数组,存储在batch中 点击打开链接 self.batch.draw...原创 2018-07-19 09:50:41 · 4061 阅读 · 0 评论 -
python代码实现无人机控制学习笔记
quad_sim.py1.signal模块 通信模块linux系统的通信基础 linux简单通信基础 linux系统中内核通过信号(signal)对进程进行作出指令,信号发出-等待-执行python中的signal模块用来处理python进程中的信号 signal模块signal.signal(signal.SIGINT, signal_handler) 使用signal.sign...原创 2018-08-13 17:06:19 · 14636 阅读 · 0 评论 -
python基础学习笔记(二)——数学模块math modules和(递归)函数functions
chapter5 模块和函数math模块 参考模块的数学运算由C语言的标准库定义,永久有效。只支持实数运算,cmath模块支持复数运算。返回结果大部分为浮点型。具体各函数作用math.gcd()函数,计算两个数的最大公约数。注意:只能是两个数math.log2(x)函数,计算以2为底,x的对数。math.log10(x)函数,计算以10为底,x的对数。math....原创 2018-09-08 16:33:06 · 529 阅读 · 0 评论 -
python基础学习笔记(三)——循环for and while
chapter6 迭代和循环for语句在python中最常用的循环是for语句,常与列表list共同使用,注意for语句的格式。计算列表中元素的平均值for value in [0,1,2,3,4,5]: print(value*value)01491625计算列表中所有元素的和mylist=[1,5,7]s=0for val in mylis...原创 2018-09-08 21:53:41 · 551 阅读 · 0 评论 -
python基础学习笔记(五)——类和继承class
类class面向对象的程序设计中的一种数据结构,内部包括数据(属性)和函数(对属性进行操作)。面向对象的程序设计三个特性:封装、继承和多态,是基于类和对象的操作。注意类的定义格式,每个类都包括一个初始化函数(构造函数)来初始化数据。注意:类中定义的每一个函数都有一个默认参数self(用于封装),且必须为第一个参数.class Person: def __init__(s...原创 2018-09-12 11:04:16 · 517 阅读 · 0 评论 -
python基础学习笔记(六)——迭代器iterators和生成器generators
注意python的编程习惯,定义函数的空行和数学符号前后的空格。chapter9迭代器 官方文档 参考网页迭代器是一个带状态的对象,在调用next()方法的时候返回容器中的下一个值,否则进入休眠状态等待被调用。iter()函数用来创建一个可迭代对象的迭代器my_iter=iter([1,2,3])print(my_iter)<list_iterato...原创 2018-09-16 22:43:50 · 357 阅读 · 0 评论 -
python基础学习笔记(四)——字典dictionary
chapter7 字典字典是一种类似于列表的数据结构,不同之处在于用自定义的关键字作为数据的索引,且每个关键字下的数据内容可为多个。注意列表的定义格式(此处用字符串作为字典的索引)ages={ "Peter":10, "Isabel":11, "Anna":9, "Thomsas":10, "Bob":10, "Joseph":原创 2018-09-10 21:02:40 · 253 阅读 · 0 评论 -
NumPy学习笔记
NumPy的学习过程主要是运行一些简单的例程,用以表明各函数的作用。学习资料参考来自:runoob网站原创 2019-03-28 22:11:28 · 276 阅读 · 0 评论