ret2.loc[ret2['INNERCODE'].map(lambda x:x[0]=='6' or x[0]=='3' or x[0]=='0' ),:]和matlab不一样的风格 - -直接用filter更方便ret2 = filter(lambda x:x[0]=='6' or x[0]=='3' and x[0]=='0',ret)用好map , filter, reducepandas,numpy,list要分清楚pandas有.map.filter没有iterlist直接用map
pandas.DataFrame.groupby DataFrame.groupby(by=None, axis=0, level=None, as_index=True, sort=True, group_keys=True, squeeze=False, **kwargs) Group series using mapper (dict or key function, apply given function to group, return result as series) or by
一.特征选择可以减少过拟合代码实例 该实例来自机器学习实战第四章 #coding=utf-8 ''' We use KNN to show that feature selection maybe reduce overfitting ''' from sklearn.base import clone from itertools import combinations import numpy as np from sklearn.model_selection import train_t
Python Data Analysis Library — pandas: Python Data Analysis Library https://pandas.pydata.org/ pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming l
pandas的学习总结 作者:csj更新时间:2017.12.31 email:59888745@qq.com 说明:因内容较多,会不断更新 xxx学习总结: 回主目录:2017 年学习记录和总结 1.pandas简介2.pandas数据结构 Series DataFrame Index csv文件读写3.常用函数: Group by Aggregate concat merge joinetc --------------------------------------------------
DataFrame DataFrame是一个表格型的数据结构,含有一组有序的列,是一个二维结构. DataFrame可以被看做是由Series组成的字典,并且共用一个索引. 一.生成方式 import numpy as np import pandas as pd a=pd.DataFrame({'one':pd.Series([1,2,3],index=['a','b','c']), 'two':pd.Series([1,2,3,4],index=['b','a','c','d'])}) a