First look at stats of pages

First look at stats of pages

import pandas as pd
from itertools import product
df_post_export = pd.read_csv("post_export.csv")
df_post_export.groupby("page_name").agg(
    **{
        "Page likes": pd.NamedAgg("page_likes", "first"),
        "Page followers": pd.NamedAgg("page_followers", "first"),
        "First post": pd.NamedAgg("posted", "min"),
        "Post count": pd.NamedAgg("link", "count"),
        **{
            f"{agg.title()} post {k}": pd.NamedAgg(k, agg)
            for k, agg in product(["reactions", "comments", "shares"], ["mean", "median"])
        },
    }
).style.background_gradient(axis=0,).set_caption("Stats of pages")
Stats of pages
  Page likes Page followers First post Post count Mean post reactions Median post reactions Mean post comments Median post comments Mean post shares Median post shares
page_name                    
972 Brewpub 1590 1655 2018-07-03 13:22:00 236 23.949153 17.000000 0.991525 0.000000 6.203390 3.000000
Beer Corner - Pub & Restaurant 4568 4684 2018-01-27 18:26:00 1076 23.225836 11.000000 0.679368 0.000000 3.572491 1.000000
BeerPanic 545 581 2019-02-22 11:47:00 34 34.676471 33.000000 1.470588 1.000000 4.205882 2.000000
BigFoot Sörfőzde 5135 5241 2013-11-18 12:51:00 2104 15.778042 10.000000 0.931084 0.000000 2.523289 1.000000
Bors Serfőzde 1232 1317 2016-09-25 21:13:00 143 28.000000 22.000000 2.160839 0.000000 2.797203 0.000000
Brandecker Sörház - Ecser 971 977 2013-03-09 09:26:00 93 6.107527 4.000000 0.451613 0.000000 0.473118 0.000000
Brew Your Mind sörfőzde 3872 4145 2015-09-11 11:39:00 757 44.125495 34.000000 1.565390 0.000000 2.113606 1.000000
Békésszentandrási Szent András Sörfőzde 29844 30557 2011-05-09 22:08:00 1388 81.615274 38.000000 9.742795 1.000000 10.463256 3.000000
Etyeki Sörmanufaktúra 20573 20817 2016-01-11 15:43:00 1447 57.737388 22.000000 27.194886 0.000000 8.912923 1.000000
FIRST The Craft Beer Co. 11406 11931 2016-11-07 11:01:00 2413 20.498135 12.000000 1.353502 0.000000 1.082470 0.000000
Fehér Nyúl Brewery & Taproom 8254 8862 2017-05-26 07:41:00 816 42.094363 27.000000 1.802696 0.000000 3.029412 1.000000
Fekete Péter Manufaktúra 568 620 2019-01-29 15:27:00 232 7.431034 6.000000 0.310345 0.000000 0.469828 0.000000
Fekete és Fiai Kézműves Sörfőzde 1145 1164 2018-04-14 09:13:00 57 50.964912 31.000000 8.421053 0.000000 19.491228 6.000000
Fóti Kézműves Sörfőzde 6102 6447 2012-04-24 18:47:00 819 22.697192 9.000000 1.245421 0.000000 4.940171 1.000000
Guri Sörfőzde 1619 1688 2017-01-11 11:21:00 526 14.176806 8.000000 0.718631 0.000000 2.534221 1.000000
Gyertyános Sörfőzde 644 662 2021-05-10 10:25:00 29 18.068966 8.000000 0.931034 0.000000 8.275862 1.000000
HBH Bajor Sörház Kazincbarcika 3962 3975 2012-11-19 10:35:00 1205 10.281328 5.000000 1.031535 0.000000 3.834855 1.000000
Hajdú Serház sörfőzde és közösségi tér 2303 2396 2016-07-31 15:24:00 427 34.271663 24.000000 3.021077 0.000000 9.836066 3.000000
Hedon 838 863 2015-01-26 20:42:00 924 38.115801 22.000000 5.942641 0.000000 4.417749 1.000000
HopTop Brewery 6150 6439 2016-04-29 14:18:00 939 36.161874 26.000000 2.854100 0.000000 2.395101 0.000000
Hopfanatic Brewery 3644 3779 2013-03-25 21:00:00 343 37.107872 22.000000 3.615160 1.000000 5.116618 1.000000
Horizont Brewing 8453 8975 2014-05-23 00:00:00 2236 25.588998 12.000000 2.315295 0.000000 1.428891 0.000000
KUNST - Kézműves Sörfőzde 708 750 2020-07-01 13:14:00 117 13.717949 11.000000 0.888889 0.000000 4.350427 3.000000
Kissler Sörfőzde 1246 1283 2020-04-13 11:48:00 108 20.796296 6.500000 0.657407 0.000000 17.083333 10.000000
Kurbely Sör 13 13 2021-03-12 11:33:00 4 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
Lőrinci Sörfőzde 635 663 2018-09-06 10:08:00 22 13.727273 9.500000 0.500000 0.000000 0.863636 0.000000
MONYO Brewing Co. 15914 16650 2014-09-11 06:51:00 1725 80.308986 52.000000 6.659130 2.000000 4.544928 2.000000
Mad Scientist 21197 22299 2015-07-15 00:00:00 3031 76.464203 54.000000 8.199274 3.000000 2.025074 1.000000
Mályi Ászok Kft 835 830 2012-12-05 23:09:00 225 9.982222 6.000000 0.595556 0.000000 1.791111 0.000000
Nopara 3139 3230 2014-01-11 18:52:00 1287 22.013986 17.000000 0.998446 0.000000 2.759907 2.000000
Nyéki sör 1478 1566 2020-06-15 07:55:00 181 16.828729 11.000000 0.790055 0.000000 6.475138 4.000000
Palóc sör 831 855 2013-09-16 13:27:00 124 19.677419 11.500000 1.282258 0.000000 3.814516 2.000000
Pannonhalmi Főapátság Sörfőzde 3268 3389 2020-07-13 15:31:00 160 117.625000 48.500000 11.962500 1.000000 8.525000 3.000000
Rehák Sörmanufaktúra 308 319 2018-01-16 14:02:00 73 19.506849 16.000000 0.575342 0.000000 1.904110 0.000000
Reketye Brewing Co. 5688 6039 2014-09-17 09:40:00 876 41.203196 26.000000 1.907534 0.000000 1.835616 1.000000
Rotburger látványsörfőzde, söröző és sörkert 4212 4290 2012-02-15 01:48:00 564 20.806738 14.000000 0.615248 0.000000 1.654255 0.000000
Ruin Brew 747 799 2021-08-01 12:17:00 140 13.357143 9.000000 0.871429 0.000000 1.135714 0.000000
Stari Sör 2639 2776 2013-02-17 12:33:00 736 20.205163 14.000000 1.226902 0.000000 3.228261 1.000000
SteamCraft Sörkert&Bisztró 1540 1614 2020-04-08 09:37:00 252 18.496032 9.000000 0.912698 0.000000 7.329365 6.000000
Synthesis 1558 1653 2016-04-26 06:45:00 443 11.121896 6.000000 0.722348 0.000000 1.744921 0.000000
Szarvasi Sörfőzde 7233 7294 2014-12-10 11:54:00 423 31.801418 22.000000 4.290780 0.000000 5.978723 1.000000
UGAR Brewery 3602 3887 2016-09-03 17:46:00 911 29.919868 21.000000 1.119649 0.000000 2.710209 2.000000
Vandál Brewing 1117 1197 2018-07-16 22:11:00 119 15.226891 11.000000 0.899160 0.000000 2.243697 1.000000
Vaskakas Sörfőzde 3015 3220 2015-03-13 17:42:00 705 22.462411 14.000000 0.680851 0.000000 3.476596 1.000000
Zirci Apátsági Manufaktúra 15728 15838 2015-06-01 00:00:00 503 181.367793 72.000000 6.520875 1.000000 16.502982 4.000000
Zsombói Sörfőzde 855 892 2016-05-27 22:33:00 33 28.393939 18.000000 2.212121 0.000000 8.090909 2.000000
hübris 3443 3688 2015-05-23 18:04:00 424 18.981132 11.000000 0.603774 0.000000 1.150943 0.000000
ÁPERTE sörök 661 670 2016-05-31 11:24:00 66 19.242424 14.000000 0.772727 0.000000 0.803030 0.000000