会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Hany47315
努力会有收获
博客园
首页
新随笔
订阅
管理
上一页
1
2
3
4
5
6
7
···
18
下一页
2021年9月30日
pandas 判断是否为空
摘要: pandas.isnull(值)
阅读全文
posted @ 2021-09-30 11:07 Hany47315
阅读(1309)
评论(0)
推荐(0)
编辑
pandas 不将第一行设置为列名
摘要: 在读取时添加 header = None
阅读全文
posted @ 2021-09-30 11:07 Hany47315
阅读(405)
评论(0)
推荐(0)
编辑
2021年9月29日
Pycharm无法输入中文
摘要: 点击菜单 “Help | Edit Custom VM options…” 添加下面一行到结尾,然后重启Pycharm-Drecreate.x11.input.method=true
阅读全文
posted @ 2021-09-29 19:41 Hany47315
阅读(148)
评论(0)
推荐(0)
编辑
2021年9月27日
argmax 获取最大数的索引 argmin 获取最小数的索引
摘要:
阅读全文
posted @ 2021-09-27 21:40 Hany47315
阅读(72)
评论(0)
推荐(0)
编辑
np.where 将符合条件的与不符合条件的分类处理
摘要:
阅读全文
posted @ 2021-09-27 21:35 Hany47315
阅读(89)
评论(0)
推荐(0)
编辑
numpy 支持切片取值,使用ix_ 也可以取到
摘要: [x 的取值范围, y 的取值范围] 取为真的数据,为假的过滤掉
阅读全文
posted @ 2021-09-27 21:26 Hany47315
阅读(30)
评论(0)
推荐(0)
编辑
np.r_ 纵向合并数据 np.c_ 横向合并数据
摘要:
阅读全文
posted @ 2021-09-27 21:10 Hany47315
阅读(23)
评论(0)
推荐(0)
编辑
np.random.permutation 打散原列表
摘要:
阅读全文
posted @ 2021-09-27 21:08 Hany47315
阅读(28)
评论(0)
推荐(0)
编辑
pyinstaller 打包文件成 exe
摘要: pyinstaller -w -p 包所在的位置 -F 代码文件.py -w 关闭 doc 界面 -F 代码文件 -p 导入的包所在的位置
阅读全文
posted @ 2021-09-27 17:50 Hany47315
阅读(35)
评论(0)
推荐(0)
编辑
matplotlib 直方图概率不为1
摘要: myarray = np.random.random(100) results, edges = np.histogram(myarray, normed=True) binWidth = edges[1] - edges[0] plt.bar(edges[:-1], results*binWidt
阅读全文
posted @ 2021-09-27 11:16 Hany47315
阅读(89)
评论(0)
推荐(0)
编辑
2021年9月26日
小提琴图 ValueError: object arrays are not supported
摘要: 绘制小提琴图时,出现 ValueError: object arrays are not supported 错误。 在修改了传入的 DataFrame 数据时,将传入要进行绘制的数据进行转换为整数,即可解决此错误。 示例: df['values'] = df['values'].astype('i
阅读全文
posted @ 2021-09-26 14:22 Hany47315
阅读(1108)
评论(0)
推荐(0)
编辑
2021年9月24日
pip 生成 requirements.txt
摘要: 在终端中输入 pip freeze >requirements.txt
阅读全文
posted @ 2021-09-24 11:59 Hany47315
阅读(69)
评论(0)
推荐(0)
编辑
os.walk 获取指定路径所有文件
摘要: for path, file_dir, files in os.walk(r'指定路径'): for file_name in files: print(os.path.join(path, file_name))
阅读全文
posted @ 2021-09-24 09:33 Hany47315
阅读(70)
评论(0)
推荐(0)
编辑
2021年9月23日
matplotlib ax.tick_params 设置坐标轴刻度标签颜色
摘要: ax.tick_params(direction='out', length=6, width=2, colors='r', grid_color='r', grid_alpha=0.5) 推荐使用 colors 传递,修改刻度标签颜色 colorscolor Tick color and labe
阅读全文
posted @ 2021-09-23 15:26 Hany47315
阅读(672)
评论(0)
推荐(0)
编辑
2021年9月21日
matplotlib 在绘制棉棒图时,进行设置属性
摘要: 进行绘制棉棒图 markerline, stemlines, baseline = plt.stem(x,y, ) # 添加默认值 plt.setp(stemlines, color= 'r') 使用 plt.stem(x,y) 进行绘制 使用 setp 方法进行设置
阅读全文
posted @ 2021-09-21 17:04 Hany47315
阅读(161)
评论(0)
推荐(0)
编辑
2021年9月20日
pdf2docx 转换 pdf 为 word文件
摘要: from pdf2docx import Converter pdf_file = '1.pdf' docx_file = '1.docx' cv = Converter(pdf_file) cv.convert(docx_file, start=0, end=None) cv.close()
阅读全文
posted @ 2021-09-20 15:59 Hany47315
阅读(710)
评论(0)
推荐(0)
编辑
pyshorteners 生成短链接
摘要: 官方文档 https://pyshorteners.readthedocs.io/en/latest/ 安装 pip install pyshorteners 我的版本 Successfully installed certifi-2021.5.30 charset-normalizer-2.0.6
阅读全文
posted @ 2021-09-20 15:23 Hany47315
阅读(144)
评论(0)
推荐(0)
编辑
pyqrcode 生成二维码到本地
摘要: 安装 pip install pyqrcode 我的版本:pyqrcode-1.2.1 pip install pypng 我的版本:pypng 0.0.21 这里要注意的是 导入时写法为 import pyqrcode import png import pyqrcode import png f
阅读全文
posted @ 2021-09-20 15:10 Hany47315
阅读(210)
评论(0)
推荐(0)
编辑
textblob 处理文本数据(英文)
摘要: 安装 pip install textblob 我的版本:0.15.3 from textblob import TextBlob string = "you arr best" # 此处的 arr 应为 are TextBlob(string).correct()
阅读全文
posted @ 2021-09-20 14:45 Hany47315
阅读(75)
评论(0)
推荐(0)
编辑
socket 获取局域网IP地址
摘要: import socket host_name = socket.gethostname() ip = socket.gethostbyname(host_name) print("本地IP地址是:" + ip)
阅读全文
posted @ 2021-09-20 14:32 Hany47315
阅读(340)
评论(0)
推荐(0)
编辑
speedtest-cli 测试电脑的网络带宽大小
摘要: 安装 pip install speedtest-cli 我的是 Successfully installed speedtest-cli-2.1.3 import speedtest、 # 创建测试对象 test = speedtest.Speedtest() down = test.downlo
阅读全文
posted @ 2021-09-20 14:16 Hany47315
阅读(230)
评论(0)
推荐(0)
编辑
使用 AutoViz 进行绘图(自动完成数据可视化)
摘要: 准备工作 安装第三方库: pip install autoviz xlrd wordcloud 我安装的 autoviz 是 0.0.84 xlrd 是 1.2.0 wordcloud 是 1.8.1 如果你有数据集,如 csv 文件,可以用你自己的。 我这里使用的是 seaborn-data 数据
阅读全文
posted @ 2021-09-20 13:49 Hany47315
阅读(730)
评论(0)
推荐(0)
编辑
2021年9月19日
使用 black 库将已经写好的python代码进行格式化
摘要: 安装 pip install black 在对应路径的终端中输入 black 文件名.py black hello.py
阅读全文
posted @ 2021-09-19 18:00 Hany47315
阅读(170)
评论(0)
推荐(0)
编辑
sns.load_dataset('tips') 由于目标计算机积极拒绝,无法连接
摘要: 我出现此问题的原因在于 计算机中 seaborn-data 文件夹内不存在数据 在下载了 GitHub 相关 seaborn-data 之后 https://github.com/mwaskom/seaborn-data 复制到 计算机中 seaborn-data 文件夹内 然后重新运行代码
阅读全文
posted @ 2021-09-19 13:08 Hany47315
阅读(456)
评论(0)
推荐(0)
编辑
module 'seaborn' has no attribute 'tsplot'
摘要: seaborn 版本问题pip uninstall seaborn 使用 0.9.0 版本,可以解决此问题 pip install seaborn==0.9.0
阅读全文
posted @ 2021-09-19 13:00 Hany47315
阅读(909)
评论(0)
推荐(0)
编辑
2021年9月18日
解决 Bad file descriptor (C:\projects\libzmq\src\epoll.cpp:100) 的一种方式
摘要: 将现有的 pyzmq 库进行卸载 pip uninstall pyzmq 然后安装低版本的 pyzmq==19.0.2 pip install pyzmq==19.0.2 注:我是使用此方式解决的。
阅读全文
posted @ 2021-09-18 23:41 Hany47315
阅读(3579)
评论(0)
推荐(0)
编辑
2021年9月17日
matplotlib 直方图 使绘制的概率为 1
摘要: n, bins = np.histogram(列表或 np.array对象, 50, normed=True) n = n * np.diff(bins) ax.hist(函数内容)
阅读全文
posted @ 2021-09-17 20:04 Hany47315
阅读(51)
评论(0)
推荐(0)
编辑
避免画图占用内存过高
摘要: matplotlib.use('agg') from lhz
阅读全文
posted @ 2021-09-17 14:16 Hany47315
阅读(74)
评论(0)
推荐(0)
编辑
2021年9月14日
matplotlib 在画图前应该提前设置好的参数
摘要: from matplotlib import rcParams #去掉顶部和右侧的线 rcParams['axes.spines.top']= False rcParams['axes.spines.right']= False #设置图的尺寸 rcParams['figure.figsize']=
阅读全文
posted @ 2021-09-14 16:55 Hany47315
阅读(56)
评论(0)
推荐(0)
编辑
2021年8月31日
pandas 显示所有的数据列
摘要: # 设置显示最大列数 与 显示宽度 pd.set_option('display.max_columns',None) pd.set_option('display.width', 300)
阅读全文
posted @ 2021-08-31 10:40 Hany47315
阅读(460)
评论(0)
推荐(0)
编辑
2021年8月30日
matplotlib 常用小技巧
摘要: https://mp.weixin.qq.com/s/Ux66-omtEU6EWEWhjQnnyw 添加标题 plt.title('示例标题') 添加图上面的文字 x y 坐标,文本内容。 plt.text(1,2,'function y=x*x') 注释 xy :备注的坐标点 xytext :备注
阅读全文
posted @ 2021-08-30 09:50 Hany47315
阅读(69)
评论(0)
推荐(0)
编辑
2021年8月29日
matplotlib 设置边框是否显示
摘要: https://blog.csdn.net/sinat_23133783/article/details/109527366 ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) ax.spines['bo
阅读全文
posted @ 2021-08-29 16:10 Hany47315
阅读(473)
评论(0)
推荐(0)
编辑
matpltolib fig,ax坐标轴,多子图,主标题
摘要: https://blog.csdn.net/htuhxf/article/details/82986440 fig = plt.figure() 参数matpltlib.pyplot.figure( num = None, # 设定figure名称。系统默认按数字升序命名的figure_num(透视
阅读全文
posted @ 2021-08-29 16:04 Hany47315
阅读(318)
评论(0)
推荐(0)
编辑
matplotlib grid 函数参数
摘要: https://blog.csdn.net/weixin_41789707/article/details/81035997 grid(b, which, axis, color, linestyle, linewidth, **kwargs) b : 布尔值 which : 取值为'major',
阅读全文
posted @ 2021-08-29 15:40 Hany47315
阅读(309)
评论(0)
推荐(0)
编辑
matplotlib ax 绘制极坐标图(部分)
摘要: 参考链接 https://blog.csdn.net/weixin_42227736/article/details/112395017 ax=plt.subplot(111,projection='polar') #设置绘图区域,建立极坐标图 projection='polar' 设置极坐标图 a
阅读全文
posted @ 2021-08-29 15:35 Hany47315
阅读(393)
评论(0)
推荐(0)
编辑
matplotlib ax 与 刻度相关函数
摘要: 参考链接https://blog.csdn.net/weixin_34498545/article/details/112631706 进行初始化 plt.figure(figsize = (8,6)) ax = plt.gca() 调整坐标轴范围 x轴 ax.set_xlim() y轴 ax.se
阅读全文
posted @ 2021-08-29 15:19 Hany47315
阅读(601)
评论(0)
推荐(0)
编辑
mysql 查询每张表中所有的字段名
摘要: select COLUMN_NAME from INFORMATION_SCHEMA.Columns where table_name='表名称' and table_schema='数据库名称';
阅读全文
posted @ 2021-08-29 15:04 Hany47315
阅读(154)
评论(0)
推荐(0)
编辑
mysql 查询数据库中所有表名称
摘要: select table_name from information_schema.tables where table_schema='数据库名称'; select table_name from information_schema.tables where table_schema='数据库名
阅读全文
posted @ 2021-08-29 15:03 Hany47315
阅读(525)
评论(0)
推荐(0)
编辑
Pycharm 添加源(使用源下载速度会加快很多)
摘要: https://pypi.tuna.tsinghua.edu.cn/simple/ http://mirrors.aliyun.com/pypi/simple/ https://pypi.mirrors.ustc.edu.cn/simple/ http://pypi.douban.com/simpl
阅读全文
posted @ 2021-08-29 14:59 Hany47315
阅读(313)
评论(0)
推荐(0)
编辑
ax 与 plt 可以使用的方法(仅包含方法名)
摘要: acorr add_artist add_callback add_child_axes add_collection add_container add_image add_line add_patch add_table angle_spectrum annotate apply_aspect
阅读全文
posted @ 2021-08-29 14:54 Hany47315
阅读(264)
评论(0)
推荐(0)
编辑
上一页
1
2
3
4
5
6
7
···
18
下一页
公告
点击右上角即可分享