05 2020 档案

摘要:编码问题 参考文档: https://blog.csdn.net/datong66/article/details/98486218 阅读全文
posted @ 2020-05-27 17:20 半日闲1 阅读(713) 评论(0) 推荐(0) 编辑
摘要:示例: data1.to_csv('b.csv', index=False, encoding='utf_8_sig') 再打开b.csv查看发现: 解决: data1.to_excel('b.xlsx', index=False, encoding='utf_8_sig') 即可! 如果是pd.r 阅读全文
posted @ 2020-05-27 11:18 半日闲1 阅读(3325) 评论(0) 推荐(0) 编辑
摘要:转换int类型:data[['m']] = data[['m']].astype(int) 报错:OverflowError: Python int too large to convert to C long 解决:data[['m']] = data[['m']].astype('int64') 阅读全文
posted @ 2020-05-27 11:10 半日闲1 阅读(1120) 评论(0) 推荐(0) 编辑
摘要:即可! 添加新的列: data['m'] = data['code'].str[:4] 阅读全文
posted @ 2020-05-27 08:31 半日闲1 阅读(5413) 评论(0) 推荐(0) 编辑
摘要:会生成多个csv文件 1. 打开cmd,切换到存放csv的文件夹 2. 输入copy *.csv all.csv all.csv任意起的名字,回车即可 阅读全文
posted @ 2020-05-27 08:06 半日闲1 阅读(1282) 评论(0) 推荐(0) 编辑
摘要:将 'a10' 列 改为 ’a11‘ 列 即可! 阅读全文
posted @ 2020-05-27 07:59 半日闲1 阅读(1613) 评论(0) 推荐(0) 编辑
摘要:示例: 阅读全文
posted @ 2020-05-26 08:43 半日闲1 阅读(2175) 评论(0) 推荐(0) 编辑
摘要:data[['m']] = data[['m']].astype(int) 若 m 列有空值或者 '' 等都无法转换 可先去除,再转换即可! df3[['列名']] = df3[['列名']].astype(object) 阅读全文
posted @ 2020-05-26 08:40 半日闲1 阅读(5106) 评论(0) 推荐(0) 编辑
摘要:示例: 过滤某列含有 '层' 的行 #删除/选取某列含有特定数值的行 df1=df1[df1['A'].isin([1])] df1[df1['A'].isin([1])] # 选取df1中A列包含数字1的行 df1=df1[~df1['A'].isin([1])] # 通过~取反,选取不包含数字1 阅读全文
posted @ 2020-05-26 08:37 半日闲1 阅读(759) 评论(0) 推荐(0) 编辑
摘要:知识点:str.extract()函数 df5['n'] = df5['n'].str.extract('(\d+)', expand=False) 阅读全文
posted @ 2020-05-26 08:25 半日闲1 阅读(4515) 评论(0) 推荐(0) 编辑
摘要:1. del df['columns'] #改变原始数据 2. df.drop('columns', axis=1) #删除不改表原始数据,可以通过重新赋值的方式赋值该数据 3. df.drop('columns', axis=1,inplace='True') #改变原始数据 columns为列名 阅读全文
posted @ 2020-05-26 08:13 半日闲1 阅读(431) 评论(0) 推荐(0) 编辑
摘要:查看行列数:df.shape 返回一个元组 查看行数:df.shape[0] 查看列数:df.shape[1] 即可! 阅读全文
posted @ 2020-05-26 08:00 半日闲1 阅读(2710) 评论(0) 推荐(0) 编辑
摘要:示例: git init xxx //初始化仓库(工作区) git add a.txt xy.sh //上传两个文件至暂存区 git commit -m "first" //上传至分支 git clone https://github.com/feiYufy123/tt //克隆网址 git rem 阅读全文
posted @ 2020-05-24 11:54 半日闲1 阅读(228) 评论(0) 推荐(0) 编辑
摘要:报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xfe in position 32: illeg 解决: import osos.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' 阅读全文
posted @ 2020-05-23 22:44 半日闲1 阅读(169) 评论(0) 推荐(0) 编辑
摘要:知识点:通过标签进行选择 .loc[] df2 = df1.loc[df['c'] == 1] 即可! 参考文档: https://www.cnblogs.com/everfight/p/pandas_select_rows.html 阅读全文
posted @ 2020-05-23 22:17 半日闲1 阅读(360) 评论(0) 推荐(0) 编辑
摘要:知识点:dropna() df1 = df.dropna(axis=0,subset = ['b']) (过滤掉b列有缺失的行,注意:若缺失值为空字符串则无法过滤) 详解: Signature: df.dropna(axis=0, how='any', thresh=None, subset=Non 阅读全文
posted @ 2020-05-23 22:04 半日闲1 阅读(7157) 评论(0) 推荐(0) 编辑
摘要:知识点:str.split() 如果切割出空值,想要去掉的话,注意:这里的空值是空字符串 df = df[df['b']!=''] 即可! 阅读全文
posted @ 2020-05-23 21:20 半日闲1 阅读(1869) 评论(0) 推荐(0) 编辑
摘要:plsqldev1304x64.msi + win64_11gR2_client 1. 安装oracle客户端 双击: 2. 配置tnsnames.ora文件 内容为: LNDB58 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TC 阅读全文
posted @ 2020-05-19 10:58 半日闲1 阅读(1216) 评论(0) 推荐(0) 编辑
摘要:去索引:添加参数 index_col=0 阅读全文
posted @ 2020-05-19 08:10 半日闲1 阅读(4142) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-05-19 07:55 半日闲1 阅读(463) 评论(0) 推荐(0) 编辑
摘要:1. 从docker_hub拉取Ubuntu镜像 sudo docker pull nvidia/cuda:10.1-devel-ubuntu16.04 2. 启动并生成一个容器 sudo docker run --name nvi -it --net host nvidia/cuda:10.1-d 阅读全文
posted @ 2020-05-14 22:37 半日闲1 阅读(1068) 评论(0) 推荐(0) 编辑
摘要:使用码云下载GitHub项目: 1. 选择要下的地址 2. 登陆码云,GitHub导入仓库 3. 下载即可 阅读全文
posted @ 2020-05-13 23:20 半日闲1 阅读(195) 评论(0) 推荐(0) 编辑
摘要:from sqlalchemy import create_engine import pandas as pd con = create_engine('oracle+cx_oracle://用户名:密码@IP:端口/库名?charset=utf8') sql = "select * from a 阅读全文
posted @ 2020-05-12 20:15 半日闲1 阅读(7566) 评论(0) 推荐(0) 编辑
摘要:报错: sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared 阅读全文
posted @ 2020-05-11 22:21 半日闲1 阅读(2458) 评论(0) 推荐(0) 编辑
摘要:如果元组中含有数字,就会报错:TypeError: sequence item 1: expected str instance, int found 解决: 去空格: 阅读全文
posted @ 2020-05-10 09:23 半日闲1 阅读(433) 评论(0) 推荐(0) 编辑
摘要:知识点:pandas + Oracle from sqlalchemy import create_engine import pandas as pd con = create_engine('oracle+cx_oracle://用户名:密码@IP:端口/库名?charset=utf8') sq 阅读全文
posted @ 2020-05-09 23:15 半日闲1 阅读(2267) 评论(0) 推荐(0) 编辑
摘要:1. 下载源码 wget http://mirrors.kernel.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.gz 2. 解压 sudo tar -xvf gcc-5.4.0.tar.gz 3. 下载编译所需依赖项: cd gcc-5.4.0 sudo ./contr 阅读全文
posted @ 2020-05-08 22:17 半日闲1 阅读(1934) 评论(0) 推荐(0) 编辑
摘要:LD_PRELOAD,是Linux系统的一个环境变量,用于动态库的加载,动态库加载的优先级最高。它可以影响程序的运行时的链接,它允许你定义在程序运行前优先加载的动态链接库。这个功能主要就是用来有选择性的载入不同动态链接库中的相同函数。通过这个环境变量,我们可以在主程序和其动态链接库的中间加载别的动态 阅读全文
posted @ 2020-05-07 22:07 半日闲1 阅读(879) 评论(0) 推荐(0) 编辑
摘要:知识点:ln命令的使用 将Python3改为Python2.7: 删除原有的软链接,建立新的软链接 大多数的默认位置在: /usr/bin 下,(若在其他位置下,使用which查找,rm删除软链接即可) omnisky@omnisky:/usr/bin$ sudo rm python omnisky 阅读全文
posted @ 2020-05-05 13:31 半日闲1 阅读(801) 评论(0) 推荐(0) 编辑
摘要:虚拟机下载 VMware官网地址:https://www.vmware.com/ 百度云地址链接:https://pan.baidu.com/s/1XbtuBr3W80qiNZOw27IaLw 提取码:yp6a Ubuntu16.04镜像文件下载地址: 中国科学技术大学:http://mirrors 阅读全文
posted @ 2020-05-04 13:53 半日闲1 阅读(375) 评论(0) 推荐(0) 编辑
摘要:知识点:Python库及简单定时器的使用 1. 鼠标自动点击屏幕代码 (1). 首先 pip install pymouse (2). 运行代码出现:ModuleNotFoundError: No module named ‘windows’ 原因:缺少pyuserinput工具 解决:pip in 阅读全文
posted @ 2020-05-03 18:50 半日闲1 阅读(3049) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示