博文

目前显示的是 十一月, 2023的博文

wsl 安装输入法

   一、准备  sudo vim /etc/locale.gen 移除这行的注释 "zh_CN.UTF8 UTF8" 下载语言: sudo locale-gen 二、安装 sudo apt install ibus ibus-libpinyin  ibus-gtk* ibus-qt* 三、配置 im-config select "OK" select "Yes" to question "Do you explicitly select the user configuration?" select "ibus" select "OK" select "OK" 四、启用 ibus service dbus-launch ibus-daemon -drx dbus-launch ibus-setup 五、重启 sudo pkill ibus-daemon dbus-launch ibus-daemon -drx 六、自启动  To automate the service Create file /etc/profile.d/ibus.sh, with the following content: export LC_CTYPE="zh_CN.UTF-8" export XIM=ibus export XIM_PROGRAM=/usr/bin/ibus export QT_IM_MODULE=ibus export GTK_IM_MODULE=ibus export XMODIFIERS=@im=ibus export DefaultIMModule=ibus ibus-daemon -drx 七、 移除fcitx, edit /etc/profile.d/fcitx.sh to remove fcitx-autostart and fcitx's variables. sudo rm /etc/profile.d/fcitx*  

Dask示例

 import numpy as np import pandas as pd import dask.dataframe as dd from dask.diagnostics import ProgressBar def windows_to_wsl_path(windows_path):     wsl_prefix = '/mnt/'     path = windows_path.replace(':', '').replace('\\', '/').lower()     wsl_path = wsl_prefix  + path     return wsl_path pv=dd.read_csv(windows_to_wsl_path(r"D:\bookbmstdr-main\PV.csv"),encoding='GB18030',dtype={'GRDA_CODE':str,'GRDA_XM':str,'YM_MC':str,'YM_BM':str,'JZ_ZC':int,'GLDW_MC':str, 'GLDW_BM':str}) pv = pv.map_partitions(lambda df: df.rename(columns={col: col.lower() for col in df.columns})) pv['csrq'] = pv['csrq'].map_partitions(pd.to_datetime, errors='coerce') pv['jz_sj'] = pv['jz_sj'].str.split(' ').str[0] pv['jz_sj']=pv['jz_sj'].map_partitions(pd.to_datetime, format='%Y-%m-%d',errors='coerce') pv['age']=