yipeiwu_com6年前
Python版本 3.0以上 分别打印列表中的元素有两种: 方法一 a = [1,2,3,4] print(*a,sep = '\n') #结果 1 2 3 4 方法二 a...
yipeiwu_com6年前
计算两个圆的交点 代码如下: # -*- coding: utf-8 -*- import math import numpy as np def insec(p1,r1,p2,r2...
yipeiwu_com6年前
一、URL路由基础 URL是web服务的路口,用户通过浏览器发送过来的任何请求都会被发送到一个指定的URL地址里,然后被响应。 在django项目中编写路由就是向外暴露我们接收哪些U...
yipeiwu_com6年前
本文实例为大家分享了python绘制热力图的具体代码,供大家参考,具体内容如下 python的热力图是用皮尔逊相关系数来查看两者之间的关联性。 #encoding:utf-8 imp...
yipeiwu_com6年前
如下所示: import numpy as np y1=np.random.randint(2,10,(5,3)) print ("排序列表:", y1) np.random.shu...
yipeiwu_com6年前
在我们使用一些数据的过程中,我们想要打乱数组内数据的顺序但不改变数据本身,可以通过改变索引值来实现,也就是将索引值重新随机排列,然后生成新的数组。功能主要由python中random模块...
yipeiwu_com6年前
如下所示: <code class="language-python">import numpy as np data = np.array([[1,1],[2,2...
yipeiwu_com6年前
前言 学习中如果碰到问题,参考官网例子: D:\boost_1_61_0\libs\python\test 参考:Boost.Python 中英文文档。 利用Boost.Python...
yipeiwu_com6年前
上节回顾 主要讲了协程、进程、异步IO多路复用。 协程和IO多路复用都是单线程的。 epoll 在linux下通过这个模块libevent.so实现 gevent&n...
yipeiwu_com6年前
Python的random.shuffle()函数可以用来乱序序列,它是在序列的本身打乱,而不是新生成一个序列。 示例: from random import shuffle x =...