Assignment1 Output
Assignment1 Output
Out[5]:
Lifetime
Page Lifetime Lifetime
Post Post Post Post
total Type Category Paid Post Total Engaged
Month Weekday Hour Total
likes Impressions Users Co
Reach
... ... ... ... ... ... ... ... ... ... ...
In [6]: df.describe()
Out[6]:
Lifetime L
Page total Post Post
Category Post Hour Paid Post Total
likes Month Weekday
Reach
In [8]: df.shape
(500, 19)
Out[8]:
Creating Subsets
0 139441 2 12 4
1 139441 2 12 3
2 139441 3 12 3
3 139441 2 12 2
4 139441 2 12 2
5 139441 2 12 1
6 139441 3 12 1
7 139441 3 12 7
8 139441 2 12 7
9 139441 3 12 6
10 139441 2 12 5
11 139441 2 12 5
12 139441 2 12 5
13 139441 2 12 5
14 138414 2 12 4
15 138414 2 12 3
16 138414 3 12 3
17 138414 1 12 2
18 138414 3 12 2
19 138414 3 12 1
20 138414 2 12 1
21 138414 1 12 7
22 138414 1 12 7
23 138414 3 12 7
24 138414 2 12 6
25 138458 2 12 6
26 138458 2 12 5
27 138458 3 12 5
28 138895 2 12 5
29 138895 1 12 4
30 138895 2 12 4
31 138895 2 12 3
32 138895 3 12 3
33 138895 3 12 2
34 138895 1 12 2
35 138895 2 12 1
36 138895 3 12 1
37 138895 1 12 7
38 138895 2 12 7
39 138895 1 12 7
40 138895 2 12 6
41 138895 1 12 6
42 138353 1 12 5
43 138353 1 12 5
44 138353 1 12 4
45 138353 1 12 4
46 138353 1 12 3
47 138353 1 12 3
48 138353 1 12 2
49 138353 1 12 2
50 138353 2 11 1
Merge Data
In [12]: merging=pd.concat([df1,df2,df3])
merging
0 139441 2 12 4
1 139441 2 12 3
2 139441 3 12 3
3 139441 2 12 2
4 139441 2 12 2
5 139441 2 12 1
6 139441 3 12 1
7 139441 3 12 7
8 139441 2 12 7
9 139441 3 12 6
10 139441 2 12 5
11 139441 2 12 5
12 139441 2 12 5
13 139441 2 12 5
14 138414 2 12 4
15 138414 2 12 3
16 138414 3 12 3
17 138414 1 12 2
18 138414 3 12 2
19 138414 3 12 1
20 138414 2 12 1
21 138414 1 12 7
22 138414 1 12 7
23 138414 3 12 7
24 138414 2 12 6
25 138458 2 12 6
26 138458 2 12 5
27 138458 3 12 5
28 138895 2 12 5
29 138895 1 12 4
30 138895 2 12 4
31 138895 2 12 3
32 138895 3 12 3
33 138895 3 12 2
34 138895 1 12 2
35 138895 2 12 1
36 138895 3 12 1
37 138895 1 12 7
38 138895 2 12 7
39 138895 1 12 7
40 138895 2 12 6
41 138895 1 12 6
42 138353 1 12 5
43 138353 1 12 5
44 138353 1 12 4
45 138353 1 12 4
46 138353 1 12 3
47 138353 1 12 3
48 138353 1 12 2
49 138353 1 12 2
50 138353 2 11 1
Sort Data
Out[13]:
Lifetime
Page Lifetime Lifetime
Post Post Post Post
total Type Category Paid Post Total Engaged
Month Weekday Hour Total
likes Impressions Users Co
Reach
... ... ... ... ... ... ... ... ... ... ...
Out[14]:
Lifetime
Page Lifetime Lifetime
Post Post Post Post
total Type Category Paid Post Total Engaged
Month Weekday Hour Total
likes Impressions Users Co
Reach
... ... ... ... ... ... ... ... ... ... ...
Transposing Data
In [16]: transposing=df.transpose()
transposing
Out[16]: 0 1 2 3 4 5 6 7 8 9
Page total
139441 139441 139441 139441 139441 139441 139441 139441 139441 139441
likes
Type Photo Status Photo Photo Photo Status Photo Photo Status Photo
Category 2 2 3 2 2 2 3 3 2 3
Post Month 12 12 12 12 12 12 12 12 12 12
Post Weekday 4 3 3 2 2 1 1 7 7 6
Post Hour 3 10 3 10 3 9 3 9 3 10
Paid 0.0 0.0 0.0 1.0 0.0 0.0 1.0 1.0 0.0 0.0
Lifetime Post
2752 10460 2413 50128 7244 10472 11692 13720 11844 4694
Total Reach
Lifetime Post
Total 5091 19057 4373 87991 13594 20849 19479 24137 22538 8668
Impressions
Lifetime
Engaged 178 1457 177 2211 671 1191 481 537 1530 280
Users
Lifetime Post
109 1361 113 790 410 1073 265 232 1407 183
Consumers
Lifetime Post
159 1674 154 1119 580 1389 364 305 1692 250
Consumptions
Lifetime Post
Impressions
by people
3078 11710 2812 61027 6228 16034 15432 19728 15220 4309
who have
liked your
Page
Lifetime Post
reach by
1640 6112 1503 32048 3200 7852 9328 11056 7912 2324
people who
like your Page
Lifetime
People who
have liked
119 1108 132 1386 396 1016 379 422 1250 199
your Page and
engaged with
your post
comment 4 5 0 58 19 1 3 0 0 3
like 79.0 130.0 66.0 1572.0 325.0 152.0 249.0 325.0 161.0 113.0
share 17.0 29.0 14.0 147.0 49.0 33.0 27.0 14.0 31.0 26.0
Total
100 164 80 1777 393 186 279 339 192 142
Interactions
In [17]: shaping=df.shape
shaping
(500, 19)
Out[17]:
like
Type Category
Link 1 75.650000
2 32.000000
3 68.000000
Photo 1 126.000000
2 235.857143
3 219.753333
Status 1 136.333333
2 182.552632
3 151.500000
Video 1 231.428571
In [ ]: