随笔分类 -  pandas数据处理

摘要:知识点:通过标签进行选择 .loc[] df2 = df1.loc[df['c'] == 1] 即可! 参考文档: https://www.cnblogs.com/everfight/p/pandas_select_rows.html 阅读全文
posted @ 2020-05-23 22:17 半日闲1 阅读(373) 评论(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 阅读(7236) 评论(0) 推荐(0)
摘要:知识点:str.split() 如果切割出空值,想要去掉的话,注意:这里的空值是空字符串 df = df[df['b']!=''] 即可! 阅读全文
posted @ 2020-05-23 21:20 半日闲1 阅读(1883) 评论(0) 推荐(0)
摘要:去索引:添加参数 index_col=0 阅读全文
posted @ 2020-05-19 08:10 半日闲1 阅读(4164) 评论(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 阅读(7675) 评论(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 阅读(2300) 评论(0) 推荐(0)