wlbk.net
当前位置:首页 >> pAnDAs Drop inDEx >>

pAnDAs Drop inDEx

data.drop(n)可以删除第i行import pandas as pddata=pd.DataFrame([[1,2,3],[4,5,6]])print data.drop(0)输出结果为 0 1 2 1 4 5 6

先看一个小例子 from pandas import Series, DataFrame data = DataFrame({'k': [1, 1, 2, 2]}) print data IsDuplicated = data.duplicated() print IsDuplicated print type(IsDuplicated) data = data.drop_duplicates() print data 执行结果...

df.dropna(axis=0, how='any', thresh=None, subset=None, inplace=False...2017-01-08 python pandas 怎么填补某一列的缺失值 2017-03-21 如何删除...

如何建立多重索引 import pandas as PDdf = PD.DataFrame()df['a'] = list(range(10,30,2))df['b'] = df['a'] // 10df.index.name = 'id'#drop : boolean, default True Delete columns to be used as the new indexdf = df.set_index([df['b'],...

df.dropna()

网站首页 | 网站地图
All rights reserved Powered by www.wlbk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com