26.多条件筛选并分类汇总 来源
import pandas as pddf = pd.read_excel(‘’)
df['mark'] = df['seq_no'].map(lambda x: 'long' if len(str(x))>5 else 'short')
res = df.groupby(['platform','name','account','mark'])['seq_no'].count()
26.多条件筛选并分类汇总 来源
import pandas as pddf = pd.read_excel(‘’)
df['mark'] = df['seq_no'].map(lambda x: 'long' if len(str(x))>5 else 'short')
res = df.groupby(['platform','name','account','mark'])['seq_no'].count()
本文标题:【python】实现excel功能
本文链接:https://www.haomeiwen.com/subject/twwqvhtx.html
网友评论