09 2021 档案
摘要:点击菜单 “Help | Edit Custom VM options…” 添加下面一行到结尾,然后重启Pycharm-Drecreate.x11.input.method=true
阅读全文
摘要:[x 的取值范围, y 的取值范围] 取为真的数据,为假的过滤掉
阅读全文
摘要:pyinstaller -w -p 包所在的位置 -F 代码文件.py -w 关闭 doc 界面 -F 代码文件 -p 导入的包所在的位置
阅读全文
摘要:myarray = np.random.random(100) results, edges = np.histogram(myarray, normed=True) binWidth = edges[1] - edges[0] plt.bar(edges[:-1], results*binWidt
阅读全文
摘要:绘制小提琴图时,出现 ValueError: object arrays are not supported 错误。 在修改了传入的 DataFrame 数据时,将传入要进行绘制的数据进行转换为整数,即可解决此错误。 示例: df['values'] = df['values'].astype('i
阅读全文
摘要:在终端中输入 pip freeze >requirements.txt
阅读全文
摘要:for path, file_dir, files in os.walk(r'指定路径'): for file_name in files: print(os.path.join(path, file_name))
阅读全文
摘要:ax.tick_params(direction='out', length=6, width=2, colors='r', grid_color='r', grid_alpha=0.5) 推荐使用 colors 传递,修改刻度标签颜色 colorscolor Tick color and labe
阅读全文
摘要:进行绘制棉棒图 markerline, stemlines, baseline = plt.stem(x,y, ) # 添加默认值 plt.setp(stemlines, color= 'r') 使用 plt.stem(x,y) 进行绘制 使用 setp 方法进行设置
阅读全文
摘要: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()
阅读全文
摘要:官方文档 https://pyshorteners.readthedocs.io/en/latest/ 安装 pip install pyshorteners 我的版本 Successfully installed certifi-2021.5.30 charset-normalizer-2.0.6
阅读全文
摘要:安装 pip install pyqrcode 我的版本:pyqrcode-1.2.1 pip install pypng 我的版本:pypng 0.0.21 这里要注意的是 导入时写法为 import pyqrcode import png import pyqrcode import png f
阅读全文
摘要:安装 pip install textblob 我的版本:0.15.3 from textblob import TextBlob string = "you arr best" # 此处的 arr 应为 are TextBlob(string).correct()
阅读全文
摘要:import socket host_name = socket.gethostname() ip = socket.gethostbyname(host_name) print("本地IP地址是:" + ip)
阅读全文
摘要:安装 pip install speedtest-cli 我的是 Successfully installed speedtest-cli-2.1.3 import speedtest、 # 创建测试对象 test = speedtest.Speedtest() down = test.downlo
阅读全文
摘要:准备工作 安装第三方库: pip install autoviz xlrd wordcloud 我安装的 autoviz 是 0.0.84 xlrd 是 1.2.0 wordcloud 是 1.8.1 如果你有数据集,如 csv 文件,可以用你自己的。 我这里使用的是 seaborn-data 数据
阅读全文
摘要:安装 pip install black 在对应路径的终端中输入 black 文件名.py black hello.py
阅读全文
摘要:我出现此问题的原因在于 计算机中 seaborn-data 文件夹内不存在数据 在下载了 GitHub 相关 seaborn-data 之后 https://github.com/mwaskom/seaborn-data 复制到 计算机中 seaborn-data 文件夹内 然后重新运行代码
阅读全文
摘要:seaborn 版本问题pip uninstall seaborn 使用 0.9.0 版本,可以解决此问题 pip install seaborn==0.9.0
阅读全文
摘要:将现有的 pyzmq 库进行卸载 pip uninstall pyzmq 然后安装低版本的 pyzmq==19.0.2 pip install pyzmq==19.0.2 注:我是使用此方式解决的。
阅读全文
摘要:n, bins = np.histogram(列表或 np.array对象, 50, normed=True) n = n * np.diff(bins) ax.hist(函数内容)
阅读全文
摘要:from matplotlib import rcParams #去掉顶部和右侧的线 rcParams['axes.spines.top']= False rcParams['axes.spines.right']= False #设置图的尺寸 rcParams['figure.figsize']=
阅读全文