logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

给 Python 字典加上点语法,实现 对象.属性 调用

class dict(dict):def __new__(cls, *args, **kwargs):return super().__new__(cls)def __getattr__(self, name):if name.startswith('__'):raise AttributeErrorreturn self.get(name)def __setattr__(self, name,

#python
python-pip镜像源永久指定安装源

每次临时指定源地址比较麻烦,可以通过以下方式配置永久源在主目录创建.pip文件夹mkdir ~/.pip编写~/.pip/pip.conf,编辑方法有很多,下面使用的geditsudo gedit ~/.pip/pip.conf并添加以下内容[global]trusted-host=pypi.douban.comindex-url=https://pypi.douban.com/simple/ti

#python#linux#ubuntu
python中swagger入门

话不多说,直接上demoimport jsonfrom flask import Flask, request, Responsefrom flasgger import swag_from, Swaggerdef create_app():app = Flask(__name__, instance_relative_config=True)app_config = {}app.config.f

#python#flask#后端
vscode 换行批量添加逗号

今天在进行react 学习的时候,mock 假数据换行的时候需要批量添加逗号,在此记录一下操作流程首先按住Ctrl+f调出搜索框点击下图画圈位置,即可调出替换框在框中输入如现图所示(.*?):(.*)$1:$2,在进行下一个数据的处理时,需要先撤销操作如下图...

#html5#npm
解决:Mac下的Mounty卷不能在读/写模式下重新挂载.可能是因为先前没有完全卸载(安全删除)

最近磁盘总是出现不能挂载的情况,使用虚拟机Windows系统进行重新安全退出磁盘,再次进行挂载依然不能挂载,最终解决办法如下:在Windows系统上调出终端# 如果我的盘浮是F:(注意下面的斜线是向左打的,不是“\f”),全英文半角chkdsk F: /f如图是修复过程再次挂载即可成功...

#macos
brew安装nginx及其使用

安装brew install nginx启动brew services start nginx查看brew services ls停止brew services stop nginx重新启动brew services restart nginxnginx常用命令nginx -h查看帮助nginx -v查看nginx的版本nginx启动服务nginx -s reload重启服务nginx -s st

#python#nginx#macos
mac使用brew安装依赖包时,一直卡在brew update解决办法

问题源于,在mac下使用brew安装依赖包时,发现一直卡在brew update这一步,本来只是想装个软件而已,结果每次都会执行一次brew的update。经过一番查询后,临时解决办法:export HOMEBREW_NO_AUTO_UPDATE=true永久解决办法vi .zsh_profileexport HOMEBREW_NO_AUTO_UPDATE=true...

#macos#python
pandas 文件读取与配置

pandas 文件读取与配置安装pandaspip install pandas运行jupyterjupyter notebook查看pandas版本号import pandas as pdpd.__version__file_path=r"C:\Users\liangsh\Desktop\flaskdemo2\dash_jianshu\indicators.csv"``````python#使用

#python#pycharm#深度学习
jupyter 安装与配置代码提示功能

jupyter 安装与配置代码提示功能先进行jupyter 安装pip install jupyter```运行jupyter```pythonjupyter notebook```jupyter安装提示功能打开终端 输入安装命令```pythonpip install jupyter_contrib_nbextensionsjupyter contrib nbextension install

#jupyter#python#深度学习
pandas切片

pandas 切片iloc 方法:用iloc方法,使用行列的位置对数据框进行切片。支持布尔切片行切片只传入一个参数时,表示对行进行切片。参数为整数返回序列,参数为列表返回数据框。正数表示正向切片, 负数表示反向切片。df = pd.read_csv(file_path,encoding="utf8",index_col=0)df.head(5)## 选取第一行(序列)df.iloc[0]# 选取第

#python#机器学习#数据挖掘
    共 11 条
  • 1
  • 2
  • 请选择