摘要:
np.cov(np.array对象, np.array对象) np.corrcoef(np.array对象,np.array对象)
阅读全文
posted @ 2021-10-01 20:59
Hany47315
阅读(307)
推荐(0)
摘要:
[(lambda x:x的表达式)(i) for i in 可迭代对象] 注: (lambda x:x的表达式)(i) 个人理解: 此时的 i 是(i) , 表示调用匿名函数
阅读全文
posted @ 2021-10-01 13:38
Hany47315
阅读(55)
推荐(0)
摘要:
value = 1 if flag else 0
阅读全文
posted @ 2021-10-01 13:32
Hany47315
阅读(54)
推荐(0)
摘要:
pandas.isnull(值)
阅读全文
posted @ 2021-09-30 11:07
Hany47315
阅读(1318)
推荐(0)
摘要:
在读取时添加 header = None
阅读全文
posted @ 2021-09-30 11:07
Hany47315
阅读(420)
推荐(0)
摘要:
点击菜单 “Help | Edit Custom VM options…” 添加下面一行到结尾,然后重启Pycharm-Drecreate.x11.input.method=true
阅读全文
posted @ 2021-09-29 19:41
Hany47315
阅读(165)
推荐(0)
posted @ 2021-09-27 21:40
Hany47315
阅读(81)
推荐(0)
posted @ 2021-09-27 21:35
Hany47315
阅读(95)
推荐(0)
摘要:
[x 的取值范围, y 的取值范围] 取为真的数据,为假的过滤掉
阅读全文
posted @ 2021-09-27 21:26
Hany47315
阅读(44)
推荐(0)
posted @ 2021-09-27 21:10
Hany47315
阅读(33)
推荐(0)
posted @ 2021-09-27 21:08
Hany47315
阅读(32)
推荐(0)
摘要:
pyinstaller -w -p 包所在的位置 -F 代码文件.py -w 关闭 doc 界面 -F 代码文件 -p 导入的包所在的位置
阅读全文
posted @ 2021-09-27 17:50
Hany47315
阅读(49)
推荐(0)
摘要:
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
阅读(101)
推荐(0)
摘要:
绘制小提琴图时,出现 ValueError: object arrays are not supported 错误。 在修改了传入的 DataFrame 数据时,将传入要进行绘制的数据进行转换为整数,即可解决此错误。 示例: df['values'] = df['values'].astype('i
阅读全文
posted @ 2021-09-26 14:22
Hany47315
阅读(1143)
推荐(0)
摘要:
在终端中输入 pip freeze >requirements.txt
阅读全文
posted @ 2021-09-24 11:59
Hany47315
阅读(81)
推荐(0)
摘要:
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
阅读(84)
推荐(0)
摘要:
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
阅读(697)
推荐(0)
摘要:
进行绘制棉棒图 markerline, stemlines, baseline = plt.stem(x,y, ) # 添加默认值 plt.setp(stemlines, color= 'r') 使用 plt.stem(x,y) 进行绘制 使用 setp 方法进行设置
阅读全文
posted @ 2021-09-21 17:04
Hany47315
阅读(176)
推荐(0)
摘要:
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
阅读(737)
推荐(0)
摘要:
官方文档 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
阅读(159)
推荐(0)
摘要:
安装 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
阅读(227)
推荐(0)
摘要:
安装 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
阅读(90)
推荐(0)
摘要:
import socket host_name = socket.gethostname() ip = socket.gethostbyname(host_name) print("本地IP地址是:" + ip)
阅读全文
posted @ 2021-09-20 14:32
Hany47315
阅读(355)
推荐(0)
摘要:
安装 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
阅读(247)
推荐(0)
摘要:
准备工作 安装第三方库: 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
阅读(788)
推荐(0)
摘要:
安装 pip install black 在对应路径的终端中输入 black 文件名.py black hello.py
阅读全文
posted @ 2021-09-19 18:00
Hany47315
阅读(180)
推荐(0)
摘要:
我出现此问题的原因在于 计算机中 seaborn-data 文件夹内不存在数据 在下载了 GitHub 相关 seaborn-data 之后 https://github.com/mwaskom/seaborn-data 复制到 计算机中 seaborn-data 文件夹内 然后重新运行代码
阅读全文
posted @ 2021-09-19 13:08
Hany47315
阅读(483)
推荐(0)
摘要:
seaborn 版本问题pip uninstall seaborn 使用 0.9.0 版本,可以解决此问题 pip install seaborn==0.9.0
阅读全文
posted @ 2021-09-19 13:00
Hany47315
阅读(976)
推荐(0)
摘要:
将现有的 pyzmq 库进行卸载 pip uninstall pyzmq 然后安装低版本的 pyzmq==19.0.2 pip install pyzmq==19.0.2 注:我是使用此方式解决的。
阅读全文
posted @ 2021-09-18 23:41
Hany47315
阅读(3642)
推荐(0)
摘要:
n, bins = np.histogram(列表或 np.array对象, 50, normed=True) n = n * np.diff(bins) ax.hist(函数内容)
阅读全文
posted @ 2021-09-17 20:04
Hany47315
阅读(65)
推荐(0)
摘要:
matplotlib.use('agg') from lhz
阅读全文
posted @ 2021-09-17 14:16
Hany47315
阅读(92)
推荐(0)
摘要:
from matplotlib import rcParams #去掉顶部和右侧的线 rcParams['axes.spines.top']= False rcParams['axes.spines.right']= False #设置图的尺寸 rcParams['figure.figsize']=
阅读全文
posted @ 2021-09-14 16:55
Hany47315
阅读(76)
推荐(0)
摘要:
# 设置显示最大列数 与 显示宽度 pd.set_option('display.max_columns',None) pd.set_option('display.width', 300)
阅读全文
posted @ 2021-08-31 10:40
Hany47315
阅读(484)
推荐(0)
摘要:
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
阅读(82)
推荐(0)
摘要:
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
阅读(481)
推荐(0)
摘要:
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
阅读(342)
推荐(0)
摘要:
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
阅读(343)
推荐(0)
摘要:
参考链接 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
阅读(426)
推荐(0)
摘要:
参考链接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
阅读(625)
推荐(0)
摘要:
select COLUMN_NAME from INFORMATION_SCHEMA.Columns where table_name='表名称' and table_schema='数据库名称';
阅读全文
posted @ 2021-08-29 15:04
Hany47315
阅读(172)
推荐(0)