Python

Python可视化库

 转自小小蒲公英原文用Python可视化库现如今大数据已人尽皆知,但在这个信息大爆炸的时代里,空有海量数据是无实际使用价值,更不要说帮助管理者进行业务决策。那么数据有什么价值呢?用什么样的手段才能把数据的价值直观而清晰的表达出来?答案是要提供像人眼一样的直觉的、交互的和反应灵敏的可视化环境。数据可视化将技术与...
代码星球·2020-11-05

Python中函数的参数传递与可变长参数

转自旭东的博客原文Python中函数的参数传递与可变长参数Python中传递参数有以下几种类型:(1)像C++一样的默认缺省函数(2)根据参数名传参数(3)可变长度参数 示例如下:(1)默认参数1deffoo(text,num=0):2printtext,num34foo("asd")#asd05foo("d...

Idea下Python开发平台的搭建

1.python的下载https://www.python.org/downloads/ 2.idea下python插件的安装点击File->Settings...->Plugins,在里面搜索python。发现搜索并没有结果。我们点击searchinrepositories链接 3.i...

Python模块常用的几种安装方式

 直接把文件拷贝到$python_dir/Lib下载模块包,进行解压,进入模块文件夹,执行:pythonsetup.pyinstall虽然Python的模块可以拷贝安装,但是一般情况下推荐制作一个安装包,即写一个setup.py文件来安装。setup.py文件的使用如下:%pythonsetup.pybuil...

树莓派Python编程指南 pdf 电子书

预览图  立即下载        ...

python 安装bs4

 codepip3installbs4  ...
代码星球·2020-11-02

Python 从两个List构造Dict

 code>>>l1=[1,2,3,4,5,6]>>>l2=[4,5,6,7,8,9]>>>print(dict(zip(l1,l2))){1:4,2:5,3:6,4:7,5:8,6:9}     &nbs...

python lambda与zip 组合使用

code#提供了两个列表,对相同位置的列表数据进行相加>>>map(lambdax,y:x+y,[1,3,5,7,9],[2,4,6,8,10])[3,7,11,15,19]       ...

python3 获取两个时间戳相差多少天

 codeimporttimeimportdatetimet=datetime.datetime.now()#当前日期t1=t.strftime('%Y-%m-%d%H:%M:%S')#转为秒级时间戳ts1=time.mktime(time.strptime(t1,'%Y-%m-%d%H:%M:%S'))#转...

python3 获取两个时间戳相差多少秒

 codeimporttimeimportdatetimet1=time.time()time.sleep(5)t2=time.time()print("相差",(datetime.datetime.fromtimestamp(t2)-datetime.datetime.fromtimestamp(t1))....

python 卡尔曼滤波

codedefg_h_filter(data,x0,dx,g,h,dt=1.0,pred=None):x=x0results=[]forzindata:x_est=x+(dx*dt)dx=dxifpredisnotNone:pred.append(x_est)residual=z-x_estdx=dx+h*(resid...
代码星球·2020-11-02

python 十进制转二,八,十六进制

code#获取用户输入十进制数dec=255print("十进制数为:",dec)print("转换为二进制为:",bin(dec))print("转换为八进制为:",oct(dec))print("转换为十六进制为:",hex(dec))      ...
代码星球·2020-11-02

python 获取最大值

code#最简单的print(max(1,2))print(max('a','b'))#也可以对列表和元组使用print(max([1,2]))print(max((1,2)))#更多实例print("80,100,1000最大值为:",max(80,100,1000))print("-20,100,400最大值为:"...
代码星球·2020-11-02

python 判断字符串是否为数字

codedefis_number(s):try:float(s)returnTrueexceptValueError:passreturnFalse#测试字符串和数字print(is_number('foo'))#Falseprint(is_number('1'))#Trueprint(is_number('1.3')...