{ "cells": [ { "cell_type": "code", "execution_count": 1, "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": 2, "id": "d20f8fbf", "metadata": {}, "outputs": [], "source": [ "posts = pd.read_sql_table('post', 'sqlite:///db6.sqlite')\n", "likes = pd.read_sql_table('like', 'sqlite:///db6.sqlite')\n", "reposts = pd.read_sql_table('repost', 'sqlite:///db6.sqlite')\n", "follows = pd.read_sql_table('follow', 'sqlite:///db6.sqlite')\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "7140b9bd", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "cf35045c14b246bfb0405f9e42c5d5ab", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Tab(children=(Output(), Output(), Output(), Output()))" ] }, "metadata": {}, "output_type": "display_data" } ], "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": 4, "id": "689b5e00", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Timespan: 0 days 13:44:19.205000\n", "Posting Accounts: 53772\n", "Liking Accounts: 70198\n", "Accounts that only posted: 13218\n", "Accounts that only liked: 29644\n", "Accounts that posted and liked: 40554\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": 5, "id": "3c6a03ff", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | cid | \n", "likes | \n", "
---|---|---|
0 | \n", "bafyreia2227oeicmtf4xigxvt7pyu4vjskwx4ybt6qs6l... | \n", "1 | \n", "
1 | \n", "bafyreia222rmtxxi6r32jvpv6ztvnf6okg4actj5kguum... | \n", "1 | \n", "
2 | \n", "bafyreia223ok3xtiywatui6vhz4wnj27dmr5axhcfrmax... | \n", "84 | \n", "
3 | \n", "bafyreia224dtxpar5micqm5alflbadh7afpvw67tflq55... | \n", "1 | \n", "
4 | \n", "bafyreia225p3me54nwasphscagmwhgixjuj2ozutf4xyg... | \n", "60 | \n", "
... | \n", "... | \n", "... | \n", "
237072 | \n", "bafyreihzzscebwopuvgkagaizjiyn7akm3bpnrzpjqes6... | \n", "1 | \n", "
237073 | \n", "bafyreihzzsv7g3fiqxke7xsvfb2lq6sjfeg5jwrxm4lxn... | \n", "2 | \n", "
237074 | \n", "bafyreihzztj6ztbyworzjigzy7muq63hrq4kdafc6nzqr... | \n", "2 | \n", "
237075 | \n", "bafyreihzzwsbv3xt5uowdtlcbbn2qlr7rrotyt4zp6v4s... | \n", "1 | \n", "
237076 | \n", "bafyreihzzwxykcadm64n4wbin5xsvmggoxpynxc53r3ns... | \n", "2 | \n", "
237077 rows × 2 columns
\n", "\n", " | account | \n", "
---|---|
0 | \n", "did:plc:lsmyaz23a3i3r75qki423npq | \n", "
1 | \n", "did:plc:wd5brnxbsbcexgmvnkenkfm3 | \n", "
2 | \n", "did:plc:kdqmfumjc75chgkf7npqw5hz | \n", "
3 | \n", "did:plc:pcdqvg6ox7mp67s4wowpqmiu | \n", "
4 | \n", "did:plc:dmmive6fhnvwl5clkhv4tpbc | \n", "
... | \n", "... | \n", "
91071 | \n", "did:plc:tru4524pbky2wgxuf37oat6d | \n", "
91072 | \n", "did:plc:7w4gxtfhm5twmuddq2bdgdkn | \n", "
91073 | \n", "did:plc:kwitm3p4rrv5tfy4hx2ayrzb | \n", "
91074 | \n", "did:plc:tjqi5lvhbzfs22x2fivei2kk | \n", "
91075 | \n", "did:plc:3dsgnxr4tjubb437zrwlmyox | \n", "
91076 rows × 1 columns
\n", "\n", " | account | \n", "likes | \n", "
---|---|---|
0 | \n", "did:plc:222ocxmd3qfo5pn7juncj5ds | \n", "5 | \n", "
1 | \n", "did:plc:222p42fegwhwfyrc3gqam76j | \n", "10 | \n", "
2 | \n", "did:plc:222rnvnta2lbl364bog2plxw | \n", "5 | \n", "
3 | \n", "did:plc:223bx4usklxh4ub66jh6kdwa | \n", "2 | \n", "
4 | \n", "did:plc:223lngzlhynd26g772d4fwsc | \n", "1 | \n", "
... | \n", "... | \n", "... | \n", "
54217 | \n", "did:plc:zzxhygmujxo3k64ailvouiti | \n", "5 | \n", "
54218 | \n", "did:plc:zzxwledpqf7ob7svaf675k4c | \n", "3 | \n", "
54219 | \n", "did:plc:zzza7zo2lho4etts27epjgpc | \n", "3 | \n", "
54220 | \n", "did:plc:zzzfnodmpmaqmyugvi77j7bi | \n", "5 | \n", "
54221 | \n", "did:plc:zzzjyeyecqee2ejfgxxobm7e | \n", "4 | \n", "
54222 rows × 2 columns
\n", "\n", " | uri | \n", "cid | \n", "authorDid | \n", "indexedAt | \n", "createdAt | \n", "subjectUri | \n", "subjectCid | \n", "subjectDid | \n", "
---|---|---|---|---|---|---|---|---|
2 | \n", "at://did:plc:tt2krpcels6fzdwt5e2iold6/app.bsky... | \n", "bafyreib3ozumx3qi3mb7wqmhedj2fftrosycnksyt25xc... | \n", "did:plc:tt2krpcels6fzdwt5e2iold6 | \n", "2023-06-28T06:50:32.931Z | \n", "2023-06-28T06:50:32.736Z | \n", "at://did:plc:m2hze6zxa744iberzknpkc3i/app.bsky... | \n", "bafyreibbhg6hz64gakzkptazxpwstfbbbid6a4fw6w5m5... | \n", "did:plc:m2hze6zxa744iberzknpkc3i | \n", "
3 | \n", "at://did:plc:wdcuds3huxctzwn35sbvskmb/app.bsky... | \n", "bafyreicosgwinajfnon2splv5u2o6zyiax5trhf6vdxlh... | \n", "did:plc:wdcuds3huxctzwn35sbvskmb | \n", "2023-06-28T06:50:33.759Z | \n", "2023-06-28T06:50:33.539Z | \n", "at://did:plc:ykzmsemoxmlzmrci2p77eqkm/app.bsky... | \n", "bafyreidheno2szedmn2ckwtm6zuoadsaxq2rpmgef2bvt... | \n", "did:plc:ykzmsemoxmlzmrci2p77eqkm | \n", "
7 | \n", "at://did:plc:ufdixs5k6dx6yhfr5a4dr5ax/app.bsky... | \n", "bafyreih3pmj7hehirajk6xpqejkzs7iyrpt4ausft3wqs... | \n", "did:plc:ufdixs5k6dx6yhfr5a4dr5ax | \n", "2023-06-28T06:50:34.059Z | \n", "2023-06-28T06:50:31.813Z | \n", "at://did:plc:yx6bxsdt445ybmjwu362riaw/app.bsky... | \n", "bafyreigupyvy2fdwglafoix3a3cgqgj43pmghearauqbx... | \n", "did:plc:yx6bxsdt445ybmjwu362riaw | \n", "
14 | \n", "at://did:plc:wdcuds3huxctzwn35sbvskmb/app.bsky... | \n", "bafyreiardnphqnh554j6ivjdgr4aaojcoxrrnqopbg6od... | \n", "did:plc:wdcuds3huxctzwn35sbvskmb | \n", "2023-06-28T06:50:37.626Z | \n", "2023-06-28T06:50:37.483Z | \n", "at://did:plc:yt5iskeftjmml3xiuhw5svxl/app.bsky... | \n", "bafyreicdboh6uublfn6zbalxg7sqx57m77d4ubtvuobv3... | \n", "did:plc:yt5iskeftjmml3xiuhw5svxl | \n", "
16 | \n", "at://did:plc:4mip3xdpj2iasxiqchzgn4sc/app.bsky... | \n", "bafyreiduxwt6r6k7sr5oxti4ftrrogwnasjjofaptf3th... | \n", "did:plc:4mip3xdpj2iasxiqchzgn4sc | \n", "2023-06-28T06:50:38.198Z | \n", "2023-06-28T06:50:37.964Z | \n", "at://did:plc:hb3rpuqloy36skpistigbc3q/app.bsky... | \n", "bafyreidblyfdtqqnvf7uxh2flv3btil42qywbbws7ucrn... | \n", "did:plc:hb3rpuqloy36skpistigbc3q | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
1043980 | \n", "at://did:plc:r23oqmp22lkgvynjji7g3jyn/app.bsky... | \n", "bafyreibwqvsnvahf3ntoc6hw7fo752k43xeci6o2uatbx... | \n", "did:plc:r23oqmp22lkgvynjji7g3jyn | \n", "2023-06-30T03:27:29.874Z | \n", "2023-06-30T03:27:30.228Z | \n", "at://did:plc:6kdg7avq4vqjgvciwdp5eb6w/app.bsky... | \n", "bafyreiavih4pssn376ltytm2nbvrs3gt5wf7maly5e6x4... | \n", "did:plc:6kdg7avq4vqjgvciwdp5eb6w | \n", "
1043983 | \n", "at://did:plc:m3dpze6kfymikzhyorn3yjve/app.bsky... | \n", "bafyreibfosoiywciqecjxtuymtcmq3ovzwgi4ot2wtweq... | \n", "did:plc:m3dpze6kfymikzhyorn3yjve | \n", "2023-06-30T03:27:29.973Z | \n", "2023-06-30T03:27:29.696Z | \n", "at://did:plc:wfvahw2jy6eonvvh5wwx2njs/app.bsky... | \n", "bafyreidyyxu6ywjezyxhjd5omnkir54lasquxmu5my66b... | \n", "did:plc:wfvahw2jy6eonvvh5wwx2njs | \n", "
1043984 | \n", "at://did:plc:uogqw3tmescpszxmep6e64x2/app.bsky... | \n", "bafyreib6wq6uv4n6hpzgq7hosxsoynp47tpwyesncegya... | \n", "did:plc:uogqw3tmescpszxmep6e64x2 | \n", "2023-06-30T03:27:30.072Z | \n", "2023-06-30T03:27:30.021Z | \n", "at://did:plc:4u42vwglz35baspkeivbgw3n/app.bsky... | \n", "bafyreifz6ww7ibjk2estslbjwtbci5ota4ccb5sn3zxqr... | \n", "did:plc:4u42vwglz35baspkeivbgw3n | \n", "
1043985 | \n", "at://did:plc:i3xuhvb7fndx2r2fhfkyi6r2/app.bsky... | \n", "bafyreicgukln6qco5dy5vypm6piqh6tr2nvoppm7dal7q... | \n", "did:plc:i3xuhvb7fndx2r2fhfkyi6r2 | \n", "2023-06-30T03:27:30.182Z | \n", "2023-06-30T03:27:29.923Z | \n", "at://did:plc:shmltckvsbkhjbcb4mwdeplx/app.bsky... | \n", "bafyreihq2tqgnarhdmf27axjhafwk46nub6yn2nzzmevp... | \n", "did:plc:shmltckvsbkhjbcb4mwdeplx | \n", "
1043986 | \n", "at://did:plc:mxroexojpobpj4e7346mb6hm/app.bsky... | \n", "bafyreif4suaf5eve4gyj5efn4z6ca6zmgygkp2pur7bqw... | \n", "did:plc:mxroexojpobpj4e7346mb6hm | \n", "2023-06-30T03:27:30.244Z | \n", "2023-06-30T03:27:29.530Z | \n", "at://did:plc:xridcxx3se5arspf5dtk2ahm/app.bsky... | \n", "bafyreihcawjk4enlfnka53sgznddhh4h6b2fjzm4vca2q... | \n", "did:plc:xridcxx3se5arspf5dtk2ahm | \n", "
212349 rows × 8 columns
\n", "\n", " | account | \n", "likes | \n", "
---|---|---|
2 | \n", "did:plc:m2hze6zxa744iberzknpkc3i | \n", "12.0 | \n", "
14 | \n", "did:plc:hb3rpuqloy36skpistigbc3q | \n", "2.0 | \n", "
27 | \n", "did:plc:vnifedvv4yrjwvi345i6ojyo | \n", "3.0 | \n", "
39 | \n", "did:plc:fxgi2crlym2f3ogvygpysomv | \n", "3.0 | \n", "
47 | \n", "did:plc:d6sjqoyj3f234j2xzbnup3xv | \n", "2.0 | \n", "
... | \n", "... | \n", "... | \n", "
42435 | \n", "did:plc:fv4ocfi7ztdxwma2wgq3mrpl | \n", "0.0 | \n", "
42436 | \n", "did:plc:6xizlc72q3qrkxaqnnfazf6v | \n", "0.0 | \n", "
42437 | \n", "did:plc:treg3m5eyfqly26syzyif4rv | \n", "0.0 | \n", "
42438 | \n", "did:plc:aq4s2bchpelfyxyj6d2lnq7v | \n", "0.0 | \n", "
42440 | \n", "did:plc:7jhmbeill5icysvwsqgaxnss | \n", "0.0 | \n", "
13829 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", "
4 | \n", "did:plc:afrooick4a2hy2m2eme5ognc | \n", "103.0 | \n", "
6 | \n", "did:plc:zsdhduo2ahpdhfa73uynnbf2 | \n", "605.0 | \n", "
7 | \n", "did:plc:d7hb4uouljzujxvm55gnanr7 | \n", "195.0 | \n", "
... | \n", "... | \n", "... | \n", "
27941 | \n", "did:plc:tjhlqxa4vqxr2yfgeykncuy6 | \n", "94.0 | \n", "
28023 | \n", "did:plc:oormkmckkga7koagos7yrcn7 | \n", "105.0 | \n", "
28442 | \n", "did:plc:z3mut2kadcqhm73epuj4vzyq | \n", "187.0 | \n", "
29049 | \n", "did:plc:ituhatvv5pyz4rwsj4hfrslh | \n", "91.0 | \n", "
29179 | \n", "did:plc:zltiiulpgfxsye6u7xd7qzjh | \n", "91.0 | \n", "
2306 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", "