博文

目前显示的是 八月, 2022的博文

R 正则表达式

 jg <- read_table('~/Documents/sjbd.csv',col_names = F) %>%    mutate(X1=str_replace(X1,"^\"","1")) %>%    mutate(X1=str_replace(X1,",\\\\N","")) %>%    filter(!str_detect(X1,"^\\,")) %>%    filter(!str_detect(X1,"^\\(")) %>%    separate(X1,c('A','B','C','D','E','F','G','H','I','M','K','N','O'),sep=",") jg <- read.table('~/Documents/sjbd.csv') 

解决 Windows11 下 wsl 2使用 matplotlib.pyplot 画图没反应的问题

图片
  获取wls2主机地址 并 添加 .bashrc文件中  Dynamically export the  DISPLAY   environment variable in WSL2; # add to ~/.bashrc, and source it. export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0 2. 下载并打开  VcXsrv  on Windows. It’s  import  to check the “Disable access contr ol” to allow connection from WSL2; 3. pycharm中设置 Setting the DISPLAY environment variable in PyCharm;

python链接oracle数据库

import pandas as pd import numpy as np import janitor import oracledb # 链接方式一 params = oracledb.ConnectParams ( host = "192.168.30.48" , port = 1521 , service_name = "JZDB1" ) con = oracledb.connect ( user = "ipvsdb" , password = "######" , params =params ) # 链接方式二 dsn= f' { "ipvsdb" } / { "#####" } @ { 1521 } :192.168.30.48/JZDB1' con=oracledb.connect ( dsn ) sqldq = ''' select dzbm,dzmc from sys_xzqh_zzjg ''' xzqh = pd.read_sql ( sqldq, con ) con.close ()

解决PyCharm中Python Console的中文乱码问题

  进入Settings->Build, Execution, Deploymer->Console->Python Console Environment variables中添加PYTHONIOENCODING=UTF-8 Settings->Editor->File Encoding 均选择UTF-8