pandas层次化索引1.创建多层行索引1)隐式构造最常见的方法是给DataFrame构造函数的index参数传递两个或更多的数组Series也可以创建多层索引In[1]:importnumpyasnpimportpandasaspdfrompandasimportSeries,DataFrameIn[3]:s=Series([1,2,3,4],index=[['a','a','b','b'],['期中','期末','期中','期末']])sOut[3]:
系统 2019-09-27 17:54:01 2377
首先,我用的工程文件是https://github.com/dBeker/Faster-RCNN-TensorFlow-Python3.5里的windows下的代码。这个代码在windows我已经调通过。过程中也是遇到windows下安装pycocotools的难题,需要去下载一个windows下的安装文件去安装,我参考了CSDN博主行胜于言的博客:windows安装pycocotools方法(windows10编译Pycocotools出错解决方案最新)
系统 2019-09-27 17:53:25 2377
importnumpyasnpimporttime1.1Gauss-Seidel迭代算法defGaussSeidel_tensor_V2(A,b,Delta,m,n,M):start=time.perf_counter()find=0X=np.ones(n)d=np.ones(n)m1=m-1m2=2-mforiinrange(M):print('X',X)x=np.copy(X)#迭代更新forjinrange(n):a=np.copy(A)forkin
系统 2019-09-27 17:53:12 2377
如下所示:importre#过滤不了\\\中文()还有――――r1=u'[a-zA-Z0-9'!"#$%&\'()*+,-./:;<=>?@,。?★、…【】《》?“”‘'![\\]^_`{|}~]+'#用户也可以在此进行自定义过滤字符#者中规则也过滤不完全r2="[\s+\.\!\/_,$%^*(+\"\']+|[+――!,。?、~@#¥%……&*()]+"#\\\可以过滤掉反向单杠和双杠,/可以过滤掉正向单杠和双杠,第一个中括号里放的是英文符号,第二个中
系统 2019-09-27 17:52:30 2377
首先需要安装itchat库,可以pipinstallitchat安装,也可以在pycharm里安装#-*-coding:utf-8-*-__author__="MuT6Sch01aR"importitchatdefget_friends():friends=itchat.get_friends(update=True)#获取微信好友列表,如果设置update=True将从服务器刷新列表foriinfriends:print(i)defmain():itch
系统 2019-09-27 17:51:50 2377
代码:#coding=utf-8importsysimportcsvimportrequestsfrombs4importBeautifulSoup'''遇到不懂的问题?Python学习交流群:821460695满足你的需求,资料都已经上传群文件,可以自行下载!'''reload(sys)sys.setdefaultencoding('utf-8')#请求头设置defdownload(url):db_data=requests.get(url)soup=B
系统 2019-09-27 17:50:27 2377
转发:https://blog.csdn.net/qq_37482544/article/details/63720726
系统 2019-09-27 17:48:11 2377
Win10系统下Python3.x环境配置https://blog.csdn.net/qq_41952474/article/details/82630551
系统 2019-09-27 17:47:47 2377
该脚本的功能是卸载android手机中安装的所有第三方应用,主要是使用adbshellpm、adbuninstall命令,所以使用的前提是需要配好adb的环境变量,下面上代码:#!/usr/bin/envpythonimportosdefuninstall():os.popen("adbwait-for-device")print"startuninstall..."forpackagesinos.popen("adbshellpmlistpackages
系统 2019-09-27 17:47:16 2377
从下面字典中查找出值为数字的字符串,并显示出对应字典的键名和该值dct={'Name':['Alice','1456'],'Age':['aa','5aa','345']}#取出字典的值forvalue1indct.values():#遍历值列表forvalue2invalue1:#判断是否为数字的字符串ifvalue2.isdigit():value=value1key=[kfor(k,v)indct.items()ifv==value]print("键
系统 2019-09-27 17:46:31 2377