编程技巧 - 文章列表
-
python利用pandas将csv转为excel
这段代码展示了使用pandas将CSV文件转换为Excel文件的基本方法。
-
TNS-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务
TNS-12514:TNS:监听程序当前无法识别连接描述符中请求的服务ORA-12514,TNS:listenerdoesnotcurrentlyknowofservicerequestedinconn可以尝试修改listener.ora此文件位于“D:\app\Administrator\virtual\product\12.2.0\dbhome_1\network\admin”增加下图中的红色
-
postgresql新建数据库及用户的方法
#创建数据库testdbcreatedatabasetestdb;#创建用户testusercreateusertestuserwithpassword123456;#授权grantallondatabasetestdbtotestuser;#修改数据库owneralterdatabasetestdbownertotestuser;*切换用户登录#创建schema,命名为schema01creat
-
postgresql查询每张表占用硬盘空间的语句
查询每张表占用磁盘空间SELECTtable_schema||.||table_nameAStable_full_name,pg_size_pretty(pg_total_relation_size(||table_schema||.||table_name||))ASsizeFROMinformation_schema.tablesORDERBYpg_total_relation_size(||
-
使用pandas处理excel数据的方法
首先引入pandasimportpandasaspd1.读取excel,指定sheet名为sheet2df=pd.read_excel(filename,sheet_name=Sheet2)2.筛选数据,如:筛选列更新时间大于2022-09-01的数据df=df[df[更新时间].apply(lambdax:x2022-09-01)]3.修改指定列的值df[客户ID]=df[客户ID].apply
-
windows使用netsh interface转发端口
将本机的端口8131转发至192.168.1.199:6543netshinterfaceportproxyaddv4tov4listenaddress=*listenport=8131connectaddress=192.168.1.199connectport=6543删掉8131端口的映射netshinterfaceportproxydeletev4tov4listenaddress=*li
-
postgresql 备份/还原数据库的方法
需要在postgres安装目录的bin目录下执行备份命令:pg_dump-Upostgres-dpostgres-h127.0.0.1-p5432-fD:\dump.sql-s-U用户名-d数据库名称-h服务器ip-p端口-f文件名-s只保存数据结构,需要保存数据则不加该参数还原命令:psql-Upostgres-dpostgres-h127.0.0.1-p5432-fD:\dump.sql
-
win10创建软链接的方法 清理C盘空间
当C盘空间不够用的时候,可以考虑创建软链接,把占用空间大的目录转移到其他磁盘去win10创建软链接的方法:mklink/JC:\Users\Administrator\AppData\Roaming\TencentD:\DiskC\Users\Administrator\AppData\Roaming\Tencent
-
centos 上安装psycopg2的方法
centos上安装psycopg2yuminstallpostgresql-develyuminstallpython3-develpip3installpsycopg2
-
python SCRAM authentication requires libpq version 10 or above
python在centos7下连接postgresql数据库报错:pythonSCRAMauthenticationrequireslibpqversion10orabove大概意思是libpg的版本低了,但使用yuminstallpostgresql-devel只能更新到9.2.24版本[参考网址](https://pkgs.org/download/postgresql-devel)安装pos