摘要: `#读取目标excel表,忽略前面2行 df=pd.read_excel(r'F:\人工智能_优学\Pandas-learn-code\pandas-learn-code\datas\student_excel\student_excel.xlsx',skiprows=2) #去掉所有为NaN的列, 阅读全文
posted @ 2020-07-20 20:26 hisweetyGirl 阅读(554) 评论(0) 推荐(0) 编辑
摘要: 1.汇总类统计 2.唯一去重和按值计数 3.相关系统和协方差 阅读全文
posted @ 2020-07-20 20:00 hisweetyGirl 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 直接赋值、apply、assign、分条件赋值 仍旧以天气数据为案例 第一步:清洗数据 df.loc[:,'bWendu']=df['bWendu].str.replace('C','').astype('int32') 上图包含了直接赋值方法 第二、apply方法 df['wendu_type'] 阅读全文
posted @ 2020-07-20 19:28 hisweetyGirl 阅读(491) 评论(0) 推荐(0) 编辑
摘要: 按数值、列表、区间、条件、函数五种方法。 Pandas查询数据的几种方法 1.df.loc(),根据行、列的标签值查询(推荐使用) 2.df.iloc(),根据行、列的数值查询(不推荐使用) 3.df.where()方法 4.df.query()方法 重点 Pandas使用df.loc查询数据的方法 阅读全文
posted @ 2020-07-20 19:09 hisweetyGirl 阅读(9458) 评论(0) 推荐(0) 编辑