{ "cells": [ { "cell_type": "code", "execution_count": 9, "id": "c0c52617", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from ipywidgets import widgets\n", "from IPython.display import display\n", "\n", "%matplotlib notebook" ] }, { "cell_type": "code", "execution_count": 3, "id": "d20f8fbf", "metadata": {}, "outputs": [], "source": [ "posts = pd.read_sql_table('post', 'sqlite:///db.sqlite')\n", "likes = pd.read_sql_table('like', 'sqlite:///db.sqlite')\n", "reposts = pd.read_sql_table('repost', 'sqlite:///db.sqlite')\n", "follows = pd.read_sql_table('follow', 'sqlite:///db.sqlite')\n" ] }, { "cell_type": "code", "execution_count": 4, "id": "7140b9bd", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "169f0c9f67a84aecb38cb8c94336f656", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Tab(children=(Output(), Output(), Output(), Output()), selected_index=0, titles=('posts', 'likes', 'reposts', …" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tabs = []\n", "for tab in (posts, likes, reposts, follows):\n", " widg = widgets.Output()\n", " with widg:\n", " display(tab)\n", " tabs.append(widg)\n", " \n", "tab = widgets.Tab(children=tabs, titles = ['posts', 'likes', 'reposts', 'follows'])\n", "tab" ] }, { "cell_type": "markdown", "id": "bc1b5a30", "metadata": {}, "source": [ "Basic Summaries\n" ] }, { "cell_type": "code", "execution_count": 5, "id": "689b5e00", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Timespan: 1 days 00:29:00.608000\n", "Posting Accounts: 134910\n", "Liking Accounts: 201814\n", "Accounts that only posted: 43655\n", "Accounts that only liked: 110559\n", "Accounts that posted and liked: 91255\n", "\n" ] } ], "source": [ "posts['indexedAt'] = pd.to_datetime(posts['indexedAt'])\n", "span = posts['indexedAt'].max() - posts['indexedAt'].min()\n", "posting_accounts = set(posts['authorDid'])\n", "liking_accounts = set(likes['authorDid'])\n", "posters_only = posting_accounts - liking_accounts\n", "likers_only = liking_accounts - posting_accounts\n", "posts_and_likes = posting_accounts.intersection(liking_accounts)\n", "\n", "print(f\"\"\"\n", "Timespan: {span}\n", "Posting Accounts: {len(posting_accounts)}\n", "Liking Accounts: {len(liking_accounts)}\n", "Accounts that only posted: {len(posters_only)}\n", "Accounts that only liked: {len(likers_only)}\n", "Accounts that posted and liked: {len(posts_and_likes)}\n", "\"\"\")" ] }, { "cell_type": "markdown", "id": "040f4a01", "metadata": {}, "source": [ "# Interaction Distributions\n", "\n", "Likes per post" ] }, { "cell_type": "code", "execution_count": 6, "id": "3c6a03ff", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | cid | \n", "likes | \n", "
---|---|---|
0 | \n", "bafyreia222dxd77nwlefofspvv4zyo4vcyidfm53vxhzl... | \n", "28 | \n", "
1 | \n", "bafyreia222hs2ffawpplfo3nfs2g4ibqleg7exybmxx4m... | \n", "1 | \n", "
2 | \n", "bafyreia222p4uouja7nmodbin7msvfyky65zd4epn4fqq... | \n", "5 | \n", "
3 | \n", "bafyreia222tx72zwcfs5mzdtssw4xcpwvmzsan6lk4yrh... | \n", "1 | \n", "
4 | \n", "bafyreia223lumxspphn5wcbw2v65aeon3l2t3frtgrik5... | \n", "3 | \n", "
... | \n", "... | \n", "... | \n", "
637533 | \n", "bafyreihzzyn6h4roumu7cebt2ywblpxryz42tt4yd66vb... | \n", "1 | \n", "
637534 | \n", "bafyreihzzyzsfj2qo4lonn3ny6kht6xy4squzfmha4luf... | \n", "1 | \n", "
637535 | \n", "bafyreihzzzd6jvfod4gmeucp4wgtn2fzxw6lggztkmeum... | \n", "2 | \n", "
637536 | \n", "bafyreihzzzfwyi7hxm5wusper7hn6qbi2bx6gibiz4skm... | \n", "95 | \n", "
637537 | \n", "bafyreihzzzgh23q2dplc32rqfuuqn6seimmujmtrq66dc... | \n", "19 | \n", "
637538 rows × 2 columns
\n", "\n", " | account | \n", "
---|---|
0 | \n", "did:plc:lhfbzpkdw2jk5i6im5pd2mi5 | \n", "
1 | \n", "did:plc:btaxnpi4resvm2uz4n7tcp3f | \n", "
2 | \n", "did:plc:ky3xc27d4ct6ntwxsu7tjpx7 | \n", "
3 | \n", "did:plc:z3ds6onyuoyfnx42qgoddhbp | \n", "
4 | \n", "did:plc:hqzxqh634sd546rfoazslb5h | \n", "
... | \n", "... | \n", "
269812 | \n", "did:plc:p6t6ari5h7bcim3iq3zs3fwr | \n", "
269813 | \n", "did:plc:omiligdebd4dwcthsxvn2fgi | \n", "
269814 | \n", "did:plc:fg6wnip4zgzz3277lz7djpet | \n", "
269815 | \n", "did:plc:5czjjn5zjvkxec6rcvvuidgq | \n", "
269816 | \n", "did:plc:jdiqko5hqd3chtepm4docjsc | \n", "
269817 rows × 1 columns
\n", "\n", " | account | \n", "likes | \n", "
---|---|---|
0 | \n", "did:plc:2224x6c53tqc6dpnbamce2yg | \n", "64 | \n", "
1 | \n", "did:plc:222ombk5yfjty5jw6r6566tk | \n", "4 | \n", "
2 | \n", "did:plc:222p42fegwhwfyrc3gqam76j | \n", "119 | \n", "
3 | \n", "did:plc:222qqedb2kgz3ulwbpboltw2 | \n", "6 | \n", "
4 | \n", "did:plc:222rnvnta2lbl364bog2plxw | \n", "575 | \n", "
... | \n", "... | \n", "... | \n", "
133639 | \n", "did:plc:zzz2awwhi7smhg3qn6th37xg | \n", "2 | \n", "
133640 | \n", "did:plc:zzza7zo2lho4etts27epjgpc | \n", "1 | \n", "
133641 | \n", "did:plc:zzzj2bhzojle3nic4wpwmcsm | \n", "1 | \n", "
133642 | \n", "did:plc:zzznrmktdln6qlvsqigd6ubc | \n", "7 | \n", "
133643 | \n", "did:plc:zzzzet3m2cnkmtsjyusz7uzs | \n", "67 | \n", "
133644 rows × 2 columns
\n", "\n", " | uri | \n", "cid | \n", "authorDid | \n", "indexedAt | \n", "createdAt | \n", "subjectUri | \n", "subjectCid | \n", "subjectDid | \n", "
---|---|---|---|---|---|---|---|---|
1 | \n", "at://did:plc:iomleec6ojlmywkrwqjbr57o/app.bsky... | \n", "bafyreidgvotn7srwum67gsv5rkjbiybtwjwpei5tvnrws... | \n", "did:plc:iomleec6ojlmywkrwqjbr57o | \n", "2023-12-27T03:12:43.896Z | \n", "2023-12-27T03:12:42.248Z | \n", "at://did:plc:btaxnpi4resvm2uz4n7tcp3f/app.bsky... | \n", "bafyreifsu35qmmr66fooemrvkke6rdd3qq5mdjvtsqs5y... | \n", "did:plc:btaxnpi4resvm2uz4n7tcp3f | \n", "
2 | \n", "at://did:plc:cakburidjcwro44hweyxazjg/app.bsky... | \n", "bafyreiawjvozspsyg5yelmmnb3hs4sp7vsjqddpr6t636... | \n", "did:plc:cakburidjcwro44hweyxazjg | \n", "2023-12-27T03:12:43.968Z | \n", "2023-12-27T03:12:43.705Z | \n", "at://did:plc:ky3xc27d4ct6ntwxsu7tjpx7/app.bsky... | \n", "bafyreib7r6526nciyilv3ky345zbmbh4w3tsarc74z72c... | \n", "did:plc:ky3xc27d4ct6ntwxsu7tjpx7 | \n", "
6 | \n", "at://did:plc:kwmi7ftr3g7hbohzauip3mxn/app.bsky... | \n", "bafyreiasf7jxlprpiix6eo4x7ifb7zeaduu2kcftyxpyi... | \n", "did:plc:kwmi7ftr3g7hbohzauip3mxn | \n", "2023-12-27T03:12:44.068Z | \n", "2023-12-27T03:12:45.463Z | \n", "at://did:plc:wxj3cnbus6js5f7hjwowoxoq/app.bsky... | \n", "bafyreifcftx7xktszbhmylitz34hf66ivmboymshgtchl... | \n", "did:plc:wxj3cnbus6js5f7hjwowoxoq | \n", "
10 | \n", "at://did:plc:43eonpufv7sg6hglanhbhraw/app.bsky... | \n", "bafyreieyyoeepsexamgybk5dun3sqxwiqftas2ent47np... | \n", "did:plc:43eonpufv7sg6hglanhbhraw | \n", "2023-12-27T03:12:44.287Z | \n", "2023-12-27T03:12:44.003Z | \n", "at://did:plc:mgsxkvihm65lecdzbavku3tk/app.bsky... | \n", "bafyreibyyeobzn34r4edmeiaarancnpjbuesdiuqxkxfy... | \n", "did:plc:mgsxkvihm65lecdzbavku3tk | \n", "
11 | \n", "at://did:plc:ipepj5vzwwzvggali4tnccwj/app.bsky... | \n", "bafyreiht7xdi2cuc6bwoer4qcf5nwzekyt7kvwq6cv4la... | \n", "did:plc:ipepj5vzwwzvggali4tnccwj | \n", "2023-12-27T03:12:44.369Z | \n", "2023-12-27T03:12:43.406Z | \n", "at://did:plc:e4r2dxzbadqabu63wne4tosx/app.bsky... | \n", "bafyreibk6afarwpw7rdzifkxbi5kgy36tolpe45lxvjzq... | \n", "did:plc:e4r2dxzbadqabu63wne4tosx | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2431516 | \n", "at://did:plc:feaa5k4utn2gayj2bxsvx3cx/app.bsky... | \n", "bafyreifm7bfz6t22liztgjjtnrm3svwiuyno37chgh4ki... | \n", "did:plc:feaa5k4utn2gayj2bxsvx3cx | \n", "2023-12-28T03:41:47.605Z | \n", "2023-12-28T03:41:46.687Z | \n", "at://did:plc:q4b6fmgkkrybhf5ejbrgcmgn/app.bsky... | \n", "bafyreibl7b6qni2jxir2v4uf5wfcurx3bbsgprvodwb2s... | \n", "did:plc:q4b6fmgkkrybhf5ejbrgcmgn | \n", "
2431523 | \n", "at://did:plc:7yeirudvbp5l3lmp4ycgbml5/app.bsky... | \n", "bafyreigj5r4j2cmgyops6naxbnk6qsdk7woqtjwy75fh4... | \n", "did:plc:7yeirudvbp5l3lmp4ycgbml5 | \n", "2023-12-28T03:41:47.666Z | \n", "2023-12-28T03:41:46.741Z | \n", "at://did:plc:fllmcdrrhebd55j4mp43igmb/app.bsky... | \n", "bafyreiatd54b5pcpu2f2cysdavzcv2iqtdput7orhgbnt... | \n", "did:plc:fllmcdrrhebd55j4mp43igmb | \n", "
2431524 | \n", "at://did:plc:qdriunexx3nobe5kpltycouy/app.bsky... | \n", "bafyreifncwwa4desh5ju6re2ykvfgchnppxvzlk5spili... | \n", "did:plc:qdriunexx3nobe5kpltycouy | \n", "2023-12-28T03:41:47.686Z | \n", "2023-12-28T03:41:46.886Z | \n", "at://did:plc:i3l64jceufl7zcbk3r2sfiyc/app.bsky... | \n", "bafyreihyyllfudoppmwlzvir5uvomf4cgxogygba7dt2l... | \n", "did:plc:i3l64jceufl7zcbk3r2sfiyc | \n", "
2431529 | \n", "at://did:plc:ycdfsvtnosafdvko26fc7i43/app.bsky... | \n", "bafyreigvptivi6zu6njihe7wfuii6rdhj5y3l6u2azihw... | \n", "did:plc:ycdfsvtnosafdvko26fc7i43 | \n", "2023-12-28T03:41:47.745Z | \n", "2023-12-28T03:41:46.679Z | \n", "at://did:plc:gxxkzpo2cw6q2ynee64rxppw/app.bsky... | \n", "bafyreicoczktoxoxozi3wurb3shbikgd5tbrukl4goavl... | \n", "did:plc:gxxkzpo2cw6q2ynee64rxppw | \n", "
2431538 | \n", "at://did:plc:ct5u4vpg5ajhx6wxihtca6qh/app.bsky... | \n", "bafyreiduxg3lwaaibwaxsrsck44rzfpefliil2otfy67z... | \n", "did:plc:ct5u4vpg5ajhx6wxihtca6qh | \n", "2023-12-28T03:41:48.066Z | \n", "2023-12-28T03:41:47.744Z | \n", "at://did:plc:4msurte3uoa37puu2ma673t6/app.bsky... | \n", "bafyreifmtmvujeeccj4t7trmzof22lhxpkiqk5s5yamty... | \n", "did:plc:4msurte3uoa37puu2ma673t6 | \n", "
546374 rows × 8 columns
\n", "\n", " | account | \n", "likes | \n", "
---|---|---|
1 | \n", "did:plc:btaxnpi4resvm2uz4n7tcp3f | \n", "2.0 | \n", "
6 | \n", "did:plc:wxj3cnbus6js5f7hjwowoxoq | \n", "2.0 | \n", "
9 | \n", "did:plc:acmcckkebktixw6lzhx76fsq | \n", "61.0 | \n", "
10 | \n", "did:plc:mgsxkvihm65lecdzbavku3tk | \n", "7.0 | \n", "
11 | \n", "did:plc:e4r2dxzbadqabu63wne4tosx | \n", "3.0 | \n", "
... | \n", "... | \n", "... | \n", "
247965 | \n", "did:plc:zeau3uhk2sm4bdpeg7cl2hk7 | \n", "0.0 | \n", "
247966 | \n", "did:plc:fl4mmwjixqnonmwfxti6tbb7 | \n", "0.0 | \n", "
247967 | \n", "did:plc:ylz7ikmlz7kn33s6xfn2hfbr | \n", "0.0 | \n", "
247968 | \n", "did:plc:6dqstbx266mlgjvdmr4u4vbw | \n", "0.0 | \n", "
247969 | \n", "did:plc:qrpae44n3nmwjvm4le6foryx | \n", "0.0 | \n", "
134907 rows × 2 columns
\n", "\n", " | account | \n", "likes | \n", "
---|---|---|
0 | \n", "did:plc:lhfbzpkdw2jk5i6im5pd2mi5 | \n", "160.0 | \n", "
3 | \n", "did:plc:z3ds6onyuoyfnx42qgoddhbp | \n", "313.0 | \n", "
4 | \n", "did:plc:hqzxqh634sd546rfoazslb5h | \n", "103.0 | \n", "
5 | \n", "did:plc:ats4shmeia7i7ildqm3denmd | \n", "405.0 | \n", "
7 | \n", "did:plc:7o55wjsyg2ylsmlr5to6gb67 | \n", "313.0 | \n", "
... | \n", "... | \n", "... | \n", "
130508 | \n", "did:plc:d5torywdns2h4kghsqmil7k6 | \n", "46.0 | \n", "
130569 | \n", "did:plc:2tdfuxjpemewkkyhi2db7lck | \n", "46.0 | \n", "
130642 | \n", "did:plc:en7khbuwadt72huhdyrvhf7s | \n", "33.0 | \n", "
131261 | \n", "did:plc:oafrik4tx7nkmqysa4kpnuv5 | \n", "243.0 | \n", "
132789 | \n", "did:plc:osxrt2mj6274mw4de6duncpu | \n", "39.0 | \n", "
13522 rows × 2 columns
\n", "\n", " | account | \n", "likes | \n", "
---|---|---|
0 | \n", "did:plc:nvog7rczakwzh5ckxnjnwqdd | \n", "2009.0 | \n", "
1 | \n", "did:plc:z3eu4ec7csnznxrrdrabudgj | \n", "331.0 | \n", "
2 | \n", "did:plc:m2hze6zxa744iberzknpkc3i | \n", "12.0 | \n", "
3 | \n", "did:plc:ykzmsemoxmlzmrci2p77eqkm | \n", "41.0 | \n", "
4 | \n", "did:plc:afrooick4a2hy2m2eme5ognc | \n", "103.0 | \n", "
... | \n", "... | \n", "... | \n", "
45665 | \n", "did:plc:efkxngznfeo2onvrjhskmmou | \n", "0.0 | \n", "
45666 | \n", "did:plc:pv4x356soulpp7spindi57gz | \n", "0.0 | \n", "
45667 | \n", "did:plc:w5reveglbupc6sz4txst2v7b | \n", "0.0 | \n", "
45668 | \n", "did:plc:7o6uylwbtcpwk5c5pqa67fsl | \n", "0.0 | \n", "
45669 | \n", "did:plc:uppr7hyd3a2zzss54drq2s5j | \n", "0.0 | \n", "
45670 rows × 2 columns
\n", "