数据信息:
Unnamed: 0 offerid sourceName affiliateId clickCount installs
0 0 21059 Clickorbits 10110006 705895 3785
1 1 1818 Mobavenue 10110080 9209 3124
2 2 1817 Mobavenue 10110080 4021 1
3 3 16493 A-Scale.IO 10110006 4651015 695
4 4 21048 A-Flyfunads-C 10110006 0 1321
5 5 18297 XYads-ID 10110006 7451168 2954
6 6 18676 A-Adaction 10110014 16421 13071
7 7 12078 A-Advolt 10110080 3335 0
8 8 12382 A-NSG Media 10110080 3918 1
9 9 1625 Mobavenue 10110006 1954129 2775
10 10 20630 comemobile 10110006 0 0
11 11 20169 A-Collectcent 10110006 5452751 3426
12 12 18379 Mobavenue 10110080 30705 26637
13 13 20698 A-Mobisummer-C 10110006 28274 108
14 14 4702 A-Justdo 10110006 16053001 22456
15 15 6987 A-Advolt 10110006 5543597 4552
16 16 12072 D-Nira 10110080 31776 27680
17 17 2022 A-AppMontize 10110080 23475 20022
18 18 20038 A-Smartconnect 10110006 513361 62
19 19 1818 Mobavenue 10110006 8329336 1421
1、 查看offer 报表的最高clickCount,最低clickCount,平均值和中位数;
python
data = pd.read_csv(filename)
data['clickCount'].max()
data['clickCount'].min()
data['clickCount'].mean()
data['clickCount'].median()
2、 查看offer 报表的最高clickCount和最低clickCount 的全部信息;
python
data = pd.read_csv(filename)
data.sort_values('clickCount').head(1) 最小值
data.sort_values('clickCount').tail(1) 最大值
data[data['clickCount'] == data['clickCount'].max()]
3、 获取installs 最高的2个 sourceName;
python
data = pd.read_csv(filename)
result = data.groupby('sourceName')['installs'].sum().sort_values(ascending=False).head(2)
4 、获取installs 最高的1个affiliateId 值;
python
data = pd.read_csv(filename)
result = data.groupby('affiliateId')['installs'].sum().nlargest(1)
5 、按affiliateId 值分组,统计每个affiliateId下offerid的个数;
python
data = pd.read_csv(filename)
result = data.groupby('affiliateId')['offerid'].count()
affiliateId
10110006 12
10110014 1
10110080 7
6、 查找 affiliateId=10110006 和clickCount< 150000,数据;
python
data = pd.read_csv(filename)
result = data[(data['affiliateId'] == 10110006) & (data['clickCount'] < 150000)]
Unnamed: 0 offerid sourceName affiliateId clickCount installs
4 4 21048 A-Flyfunads-C 10110006 0 1321
10 10 20630 comemobile 10110006 0 0
13 13 20698 A-Mobisummer-C 10110006 28274 108
7、 查找 affiliateId=10110006 和clickCount> 150000,数据, 并按照clickCount排序;
python
data = pd.read_csv(filename)
result = data[(data['affiliateId'] == 10110006) & (data['clickCount'] > 150000)].sort_values('clickCount',ascending=False)
Unnamed: 0 offerid sourceName affiliateId clickCount installs
14 14 4702 A-Justdo 10110006 16053001 22456
19 19 1818 Mobavenue 10110006 8329336 1421
5 5 18297 XYads-ID 10110006 7451168 2954
15 15 6987 A-Advolt 10110006 5543597 4552
11 11 20169 A-Collectcent 10110006 5452751 3426
3 3 16493 A-Scale.IO 10110006 4651015 695
9 9 1625 Mobavenue 10110006 1954129 2775
0 0 21059 Clickorbits 10110006 705895 3785
18 18 20038 A-Smartconnect 10110006 513361 62