随笔分类 -  python

摘要:df[df['列的字段名'].isnull()] 阅读全文
posted @ 2020-07-06 15:59 胸怀丶若谷 阅读(1841) 评论(0) 推荐(0) 编辑
摘要:Ctrl+p 查看参数 Ctrl+r 替换当前文件中的文本 阅读全文
posted @ 2020-07-01 08:31 胸怀丶若谷 阅读(143) 评论(0) 推荐(0) 编辑
摘要:point_x = [A_x, B_x, C_x, D_x] point_y = [A_y, B_y, C_y, D_y] points_tulpe = list(zip(point_x, point_y)) print(points_tulpe) >>>[(A_x,A_y),(B_x,B_y),( 阅读全文
posted @ 2020-05-07 13:29 胸怀丶若谷 阅读(5408) 评论(0) 推荐(0) 编辑
摘要:needdata = ' '.join(needdata.split()) 阅读全文
posted @ 2020-05-07 11:35 胸怀丶若谷 阅读(332) 评论(0) 推荐(0) 编辑
摘要:f3 = open(file=path,mode='rb') data = f3.read() # print(data) f3.close() result = chardet.detect(data) print(result) 结果: {'encoding': 'Big5', 'confide 阅读全文
posted @ 2020-05-07 10:34 胸怀丶若谷 阅读(223) 评论(0) 推荐(0) 编辑
摘要:enumerate()(单词意思是枚举的意思)是python中的内置函数, enumerate(X,[start=0]) 函数中的参数X可以是一个迭代器(iterator)或者是一个序列, start是起始计数值,默认从0开始。X可以是一个字典。(注意观察下面的输出结果) >>> list1 = [ 阅读全文
posted @ 2020-04-29 09:31 胸怀丶若谷 阅读(1772) 评论(0) 推荐(0) 编辑
摘要:>>>list1 = ['key1','key2','key3'] >>>list2 = ['1','2','3'] >>>dict(zip(list1,list2)) {'key1':'1','key2':'2','key3':'3'} 阅读全文
posted @ 2020-04-29 09:13 胸怀丶若谷 阅读(884) 评论(0) 推荐(0) 编辑
摘要:def check_str(value): # 检查你输入的是否是字符类型 if isinstance(value, str): # 判断字符串以什么结尾 if value.endswith('.sh'): return '%s 是以.sh结尾的字符串' % value # 判断字符串以什么开头 e 阅读全文
posted @ 2020-04-27 09:15 胸怀丶若谷 阅读(1146) 评论(0) 推荐(0) 编辑
摘要:urls = driver.find_elements_by_xpath("//a") for url in urls: print(url.get_attribute("href")) //获取特定位置的a标签 FLODERURLSLIST = [] floderurls = browser.fi 阅读全文
posted @ 2020-04-24 09:22 胸怀丶若谷 阅读(12457) 评论(0) 推荐(1) 编辑
摘要:切换: # 启动python 3 32位版本py -3.7-32 # 启动python 3 64位版本py -3.7-64 # 启动python 2.7 32位版本py -2.7-32 # 启动python 2 64位版本py -2.7-64 pip使用 py -3.6 -m pip list 虚拟 阅读全文
posted @ 2020-04-15 09:13 胸怀丶若谷 阅读(843) 评论(0) 推荐(0) 编辑
摘要:import pandas as pd #设置显示的最大列、宽等参数,消除打印不完全中间的省略号 pd.set_option("display.width",1000) #加了这一行那表格就不会分段出现了 pd.set_option("display.width",1000) #显示所有列 pd.s 阅读全文
posted @ 2020-04-14 15:05 胸怀丶若谷 阅读(1892) 评论(0) 推荐(0) 编辑
摘要:import pandas as pd #设置显示的最大列、宽等参数,消除打印不完全中间的省略号 pd.set_option("display.width",1000) #加了这一行那表格就不会分段出现了 pd.set_option("display.width",1000) #显示所有列 pd.s 阅读全文
posted @ 2020-04-14 15:03 胸怀丶若谷 阅读(2705) 评论(0) 推荐(0) 编辑
摘要:下载vc_redist.x64.exe并在不能运行的电脑上运行即可. vc_redist.x64.exe的作用:一款Visual C++的运行库,里面包含了一些Visual C++的库函数。Visual C++开发的Windows应用程序需要这个运行时库的支持才能运行 阅读全文
posted @ 2020-04-14 13:29 胸怀丶若谷 阅读(2702) 评论(0) 推荐(0) 编辑
摘要:在pycharm中安装,和直接输入pip install pyinstaller 均报错, 最后,输入pip install -i https://pypi.douban.com/simple/ pyinstaller 问题解决。 pyinstaller打包exe文件时,注意包的导入. 阅读全文
posted @ 2020-03-31 14:31 胸怀丶若谷 阅读(838) 评论(0) 推荐(0) 编辑
摘要:pip install --user --upgrade pip成功升级 阅读全文
posted @ 2020-03-31 14:22 胸怀丶若谷 阅读(106) 评论(0) 推荐(0) 编辑
摘要:求和的方式很简单,如下所示: number_of_declarations = data[4].sum()//中括号中为要求和的列 阅读全文
posted @ 2020-03-11 18:41 胸怀丶若谷 阅读(13087) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/missyougoon/article/details/83926840 数据去重可以使用duplicated()和drop_duplicates()两个方法。 DataFrame.duplicated(subset = None,keep =‘ 阅读全文
posted @ 2020-03-11 18:30 胸怀丶若谷 阅读(4331) 评论(0) 推荐(1) 编辑
摘要:进入文件所在的路径输入: python 文件名 阅读全文
posted @ 2020-03-09 09:30 胸怀丶若谷 阅读(1065) 评论(0) 推荐(0) 编辑
摘要:venv 模块支持使用自己的站点目录创建轻量级“虚拟环境”,可选择与系统站点目录隔离。每个虚拟环境都有自己的 Python 二进制文件(与用于创建此环境的二进制文件的版本相匹配),并且可以在其站点目录中拥有自己独立的已安装 Python 软件包集。在同一台机器,使用多个不同的pip环境。可以解决不同 阅读全文
posted @ 2019-12-21 14:40 胸怀丶若谷 阅读(174) 评论(0) 推荐(0) 编辑
摘要:https://pypi.douban.com/simple/ 豆瓣源 pip install -i https://pypi.douban.com/simple/ pymysql # pymysql替换成你想安装的包名 清华:https://pypi.tuna.tsinghua.edu.cn/si 阅读全文
posted @ 2019-12-08 18:33 胸怀丶若谷 阅读(227) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示