2019-04-08 python一些函数总结

query函数

index=df.query('index>200').index (引号为必须)

loc, iloc函数

df.loc[(df['group']=='treatment')!=(df['landing_page']=='new')].count()

df_test=df.loc[~((df['group']=='treatment')!=(df['landing_page']=='new'))]

df_test1.loc[(df_test1.['group']=='treatment')].['converted'].mean()

duplicated, drop_duplicates函数

df_test.loc(df_test['user_id'].duplicated(keep=False))

df_test1=df_test.drop_duplicates('user_id',keep='first')

你可能感兴趣的:(2019-04-08 python一些函数总结)