290 lines
14 KiB
Plaintext
290 lines
14 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"%matplotlib inline"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Count emoji occurences"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"import numpy as np\n",
|
|
"import json\n",
|
|
"import glob\n",
|
|
"import matplotlib\n",
|
|
"import matplotlib.pyplot as plt\n",
|
|
"from __future__ import unicode_literals\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"json_root = \"./emoji_counts/\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"json_files = sorted(glob.glob(json_root + \"/*.json\"))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"['./emoji_counts/twitter_emoji_count_2017-12.json',\n",
|
|
" './emoji_counts/twitter_emoji_count_2017_11.json']"
|
|
]
|
|
},
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"json_files"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"json_lists = []"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 7,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"for path in json_files:\n",
|
|
" with open(path) as f:\n",
|
|
" data = json.load(f)\n",
|
|
" json_lists.append(data)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 8,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"merged_dict = {}\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 9,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"for j in json_lists:\n",
|
|
" for emoji in j.keys():\n",
|
|
" if emoji in merged_dict:\n",
|
|
" merged_dict[emoji] = merged_dict[emoji] + j[emoji]\n",
|
|
" else:\n",
|
|
" merged_dict[emoji] = j[emoji]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 10,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"n_top = 50"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 11,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"keysort = np.argsort(list(merged_dict.values()))[-n_top:]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 12,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# for apple:\n",
|
|
"from matplotlib.font_manager import FontProperties\n",
|
|
"\n",
|
|
"prop = FontProperties(fname='/System/Library/Fonts/Apple Color Emoji.ttc')\n",
|
|
"plt.rcParams['font.family'] = prop.get_family()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 13,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/png":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ug9SK6025HAv+V7ojHTw+sg4vUM567gDcDP0b3pn0M3X+gVzAk48nM7RHxx8B/pzvK9st0ofowujB6G93pqqHR8/z8Od2F7HfS/WH9MbpTPEPzeptjLO8APsEQjQUczxB4DDgtIk4AXjEzQzwiDgW+n+4U9iMD7N+CtefmaeA0YG1EvBt4iu4Sj/9I91592QC7eMD5wbkD1maJfiQzn2rLy4H3DuEs0WPoQsFtdP/ZHA58A7gc+G+Z+fsD7N6i9Yznf9CN50i68VzGcI7n++lOc/w63UcSPEd3KufH6WaOPjXA7i3arNfbHroQ+o/ApQzZ8zNKYwHHU11EbKGb9fpv6N4HHqM73XsD3T+jV2bmUBw17Hlu/oDurMFzdNfoXc0QPjfzMbAN2KgENoCIOBy4hG6mztF0p94+mpkPDLRjSzSC4zmV7g35TLpTozuB38jMbwy0Y0s0Ss/PKI0FHE9l7W/MNrqJBjvozrQdD2wCPjmEny03Ms/NfAxsAxYRP013fdS3WukQ4LOZ+bHB9UqSNKraDMufovvbczTwEN0H5t430I5pTgY2SZKk4vwcNkmSpOIMbJIkScUZ2CRJkoozsEmSJBVnYJMkSSrOwCZJklTc/wfcVNDj5quiiQAAAABJRU5ErkJggg==\n",
|
|
"text/plain": [
|
|
"<matplotlib.figure.Figure at 0x10d80ce48>"
|
|
]
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"#matplotlib.rc('font', family='Arial')\n",
|
|
"plt.figure(figsize=(10,5))\n",
|
|
"plt.bar(np.array(list(merged_dict.keys()))[keysort], np.array(list(merged_dict.values()))[keysort], color='g')\n",
|
|
"plt.savefig(\"histogram.png\", bbox_inches='tight')\n",
|
|
"plt.show()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 14,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"array([106, 14, 46, 41, 74, 91, 87, 104, 69, 11, 52, 81, 15,\n",
|
|
" 38, 16, 27, 65, 66, 28, 1, 57, 31, 55, 53, 33, 21,\n",
|
|
" 2, 59, 29, 6, 32, 34, 13, 49, 37, 54, 40, 10, 4,\n",
|
|
" 23, 50, 25, 8, 17, 5, 24, 7, 9, 3, 0])"
|
|
]
|
|
},
|
|
"execution_count": 14,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"keysort"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 15,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"array(['🤔', '🤣', '💕', '😚', '🤦', '😓', '😥', '🙄', '😻', '😣', '😛', '😝', '😃',\n",
|
|
" '😐', '😈', '😡', '😞', '😪', '😑', '😕', '😬', '😱', '😇', '😄', '😆', '😴',\n",
|
|
" '🙈', '😜', '😤', '😫', '😳', '😋', '😀', '😌', '😏', '😔', '😒', '😎', '😢',\n",
|
|
" '😅', '😁', '😉', '🙌', '🙏', '😘', '😊', '😩', '😍', '😭', '😂'],\n",
|
|
" dtype='<U1')"
|
|
]
|
|
},
|
|
"execution_count": 15,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"np.array(list(merged_dict.keys()))[keysort]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 16,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'🤔🤣💕😚🤦😓😥🙄😻😣😛😝😃😐😈😡😞😪😑😕😬😱😇😄😆😴🙈😜😤😫😳😋😀😌😏😔😒😎😢😅😁😉🙌🙏😘😊😩😍😭😂'"
|
|
]
|
|
},
|
|
"execution_count": 16,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"''.join(np.array(list(merged_dict.keys()))[keysort])"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.6.3"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|