摘要: `a = [1,2,3,4,5,6,7,8,9,10]` = = 包含开头, 不包含 结尾。 : 从头一直到最后一个元素 , 但不包含最后一个元素 。 Python这样做的原因是: `word[2:] 除了前两个,其他全部选取` 阅读全文
posted @ 2017-07-02 22:37 2021年的顺遂平安君 阅读(6015) 评论(0) 推荐(0)
摘要: a = [1,2,3,4,5,6,7,8,9,10] a[0:1] = [1] a[0:2] = [1,2] 包含开头,不包含结尾。 a [:-1]: 从头一直到最后一个元素a[-1],但不包含最后一个元素。 Python这样做的原因是: wor... 阅读全文
posted @ 2017-07-02 22:37 2021年的顺遂平安君 阅读(61) 评论(0) 推荐(0)
摘要: subplot(arg1, arg2, arg3) arg1: 在垂直方向同时画几张图 arg2: 在水平方向同时画几张图 arg3: 当前命令修改的是第几张图 t = np.arange(0,5,0.1)y1 = np.sin(2*np.pi*t)y... 阅读全文
posted @ 2017-07-02 20:10 2021年的顺遂平安君 阅读(144) 评论(0) 推荐(0)
摘要: `subplot(arg1, arg2, arg3)` : 在垂直方向同时画几张图 : 在水平方向同时画几张图 : 当前命令修改的是第几张图 阅读全文
posted @ 2017-07-02 20:10 2021年的顺遂平安君 阅读(11933) 评论(0) 推荐(0)
摘要: Pylab combines the functionality of pyplot with the capabilities of NumPy in a single namespace, and therefore you do not need to import NumPy separat 阅读全文
posted @ 2017-07-02 17:45 2021年的顺遂平安君 阅读(1420) 评论(0) 推荐(0)
摘要: Pylab combines the functionality of pyplot with the capabilities of NumPy in a single namespace, and therefore you do not nee... 阅读全文
posted @ 2017-07-02 17:45 2021年的顺遂平安君 阅读(71) 评论(0) 推荐(0)
摘要: Figure is the object with the highest level in the hierarchy. It corresponds to the entire graphical representation and gen... 阅读全文
posted @ 2017-07-02 17:40 2021年的顺遂平安君 阅读(54) 评论(0) 推荐(0)
摘要: Figure is the object with the highest level in the hierarchy. It corresponds to the entire graphical representation and generally can contain many Axe 阅读全文
posted @ 2017-07-02 17:40 2021年的顺遂平安君 阅读(852) 评论(0) 推荐(1)
摘要: 随机产生0~7之间的 整数 , 不包含7 。 随机从 中产生5个数,放入一个 list 。 从 中随便挑选一个元素。 对 中的元素进行重新洗牌。洗牌之后 中元素的排列顺序随机发生变化 。 阅读全文
posted @ 2017-07-02 15:16 2021年的顺遂平安君 阅读(336) 评论(0) 推荐(0)
摘要: random.randrange(1,10) 随机产生0~7之间的整数,不包含7。 random.sample(range(100), 5) 随机从range(100)中产生5个数,放入一个list。 random.choice() possib... 阅读全文
posted @ 2017-07-02 15:16 2021年的顺遂平安君 阅读(68) 评论(0) 推荐(0)
摘要: Pythonsorted()函数中可以加入key=参数。作用是每个元素在排序之前,先作为key=中FUNCTION的参数,用FUNCTION的输出结果作为依据来排序。 print (sorted("This is a test string from D... 阅读全文
posted @ 2017-07-02 14:48 2021年的顺遂平安君 阅读(71) 评论(0) 推荐(0)
摘要: Python 函数中可以加入 参数。作用是每个元素在排序之前,先作为 中 FUNCTION 的参数,用 FUNCTION 的输出结果作为依据来排序。 输出结果: 这里定义了一个 的函数。把一个 list 作为输入参数 student ,返回list中的第1个元素 。 阅读全文
posted @ 2017-07-02 14:48 2021年的顺遂平安君 阅读(201) 评论(0) 推荐(0)