Skip to content

Instantly share code, notes, and snippets.

@acstrahl
Last active December 18, 2024 22:40
Show Gist options
  • Save acstrahl/2b1298858fd8f9a9a4df809654ad4c2d to your computer and use it in GitHub Desktop.
Save acstrahl/2b1298858fd8f9a9a4df809654ad4c2d to your computer and use it in GitHub Desktop.
Project walkthrough demo
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Profitable App Exploration"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"UPDATE UPDATE We will explore datasets about apps on the iOS App Store and Google Play Store to see what kinds of free apps are most profitable."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from csv import reader\n",
"\n",
"### The Google Play data set ###\n",
"opened_file = open('googleplaystore.csv')\n",
"read_file = reader(opened_file)\n",
"android = list(read_file)\n",
"android_header = android[0]\n",
"android = android[1:]"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['App',\n",
" 'Category',\n",
" 'Rating',\n",
" 'Reviews',\n",
" 'Size',\n",
" 'Installs',\n",
" 'Type',\n",
" 'Price',\n",
" 'Content Rating',\n",
" 'Genres',\n",
" 'Last Updated',\n",
" 'Current Ver',\n",
" 'Android Ver']"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"android_header"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['Photo Editor & Candy Camera & Grid & ScrapBook', 'ART_AND_DESIGN', '4.1', '159', '19M', '10,000+', 'Free', '0', 'Everyone', 'Art & Design', 'January 7, 2018', '1.0.0', '4.0.3 and up']\n",
"\n",
"\n",
"['Coloring book moana', 'ART_AND_DESIGN', '3.9', '967', '14M', '500,000+', 'Free', '0', 'Everyone', 'Art & Design;Pretend Play', 'January 15, 2018', '2.0.0', '4.0.3 and up']\n",
"\n",
"\n",
"['U Launcher Lite – FREE Live Cool Themes, Hide Apps', 'ART_AND_DESIGN', '4.7', '87510', '8.7M', '5,000,000+', 'Free', '0', 'Everyone', 'Art & Design', 'August 1, 2018', '1.2.4', '4.0.3 and up']\n",
"\n",
"\n",
"['Sketch - Draw & Paint', 'ART_AND_DESIGN', '4.5', '215644', '25M', '50,000,000+', 'Free', '0', 'Teen', 'Art & Design', 'June 8, 2018', 'Varies with device', '4.2 and up']\n",
"\n",
"\n",
"['Pixel Draw - Number Art Coloring Book', 'ART_AND_DESIGN', '4.3', '967', '2.8M', '100,000+', 'Free', '0', 'Everyone', 'Art & Design;Creativity', 'June 20, 2018', '1.1', '4.4 and up']\n",
"\n",
"\n",
"Number of rows: 10841\n",
"Number of columns: 13\n"
]
}
],
"source": [
"def explore_data(dataset, start, end, rows_and_columns=False):\n",
" dataset_slice = dataset[start:end] \n",
" for row in dataset_slice:\n",
" print(row)\n",
" print('\\n') # adds a new (empty) line after each row\n",
"\n",
" if rows_and_columns:\n",
" print('Number of rows:', len(dataset))\n",
" print('Number of columns:', len(dataset[0]))\n",
" \n",
"explore_data(android, 0, 5, rows_and_columns=True)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['Jazz Wi-Fi', 'COMMUNICATION', '3.4', '49', '4.0M', '10,000+', 'Free', '0', 'Everyone', 'Communication', 'February 10, 2017', '0.1', '2.3 and up']\n",
"\n",
"\n",
"['Xposed Wi-Fi-Pwd', 'PERSONALIZATION', '3.5', '1042', '404k', '100,000+', 'Free', '0', 'Everyone', 'Personalization', 'August 5, 2014', '3.0.0', '4.0.3 and up']\n",
"\n",
"\n",
"['Life Made WI-Fi Touchscreen Photo Frame', '1.9', '19', '3.0M', '1,000+', 'Free', '0', 'Everyone', '', 'February 11, 2018', '1.0.19', '4.0 and up']\n",
"\n",
"\n",
"['osmino Wi-Fi: free WiFi', 'TOOLS', '4.2', '134203', '4.1M', '10,000,000+', 'Free', '0', 'Everyone', 'Tools', 'August 7, 2018', '6.06.14', '4.4 and up']\n",
"\n",
"\n",
"['Sat-Fi Voice', 'COMMUNICATION', '3.4', '37', '14M', '1,000+', 'Free', '0', 'Everyone', 'Communication', 'November 21, 2014', '2.2.1.5', '2.2 and up']\n",
"\n",
"\n"
]
}
],
"source": [
"explore_data(android,10470, 10475)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"del android[10472]"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['Jazz Wi-Fi', 'COMMUNICATION', '3.4', '49', '4.0M', '10,000+', 'Free', '0', 'Everyone', 'Communication', 'February 10, 2017', '0.1', '2.3 and up']\n",
"\n",
"\n",
"['Xposed Wi-Fi-Pwd', 'PERSONALIZATION', '3.5', '1042', '404k', '100,000+', 'Free', '0', 'Everyone', 'Personalization', 'August 5, 2014', '3.0.0', '4.0.3 and up']\n",
"\n",
"\n",
"['osmino Wi-Fi: free WiFi', 'TOOLS', '4.2', '134203', '4.1M', '10,000,000+', 'Free', '0', 'Everyone', 'Tools', 'August 7, 2018', '6.06.14', '4.4 and up']\n",
"\n",
"\n",
"['Sat-Fi Voice', 'COMMUNICATION', '3.4', '37', '14M', '1,000+', 'Free', '0', 'Everyone', 'Communication', 'November 21, 2014', '2.2.1.5', '2.2 and up']\n",
"\n",
"\n",
"['Wi-Fi Visualizer', 'TOOLS', '3.9', '132', '2.6M', '50,000+', 'Free', '0', 'Everyone', 'Tools', 'May 17, 2017', '0.0.9', '2.3 and up']\n",
"\n",
"\n"
]
}
],
"source": [
"explore_data(android,10470, 10475)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['Box', 'BUSINESS', '4.2', '159872', 'Varies with device', '10,000,000+', 'Free', '0', 'Everyone', 'Business', 'July 31, 2018', 'Varies with device', 'Varies with device']\n",
"['Box', 'BUSINESS', '4.2', '159872', 'Varies with device', '10,000,000+', 'Free', '0', 'Everyone', 'Business', 'July 31, 2018', 'Varies with device', 'Varies with device']\n",
"['Box', 'BUSINESS', '4.2', '159872', 'Varies with device', '10,000,000+', 'Free', '0', 'Everyone', 'Business', 'July 31, 2018', 'Varies with device', 'Varies with device']\n",
"['Zenefits', 'BUSINESS', '4.2', '296', '14M', '50,000+', 'Free', '0', 'Everyone', 'Business', 'June 15, 2018', '3.2.1', '4.1 and up']\n",
"['Zenefits', 'BUSINESS', '4.2', '296', '14M', '50,000+', 'Free', '0', 'Everyone', 'Business', 'June 15, 2018', '3.2.1', '4.1 and up']\n",
"['Google Ads', 'BUSINESS', '4.3', '29313', '20M', '5,000,000+', 'Free', '0', 'Everyone', 'Business', 'July 30, 2018', '1.12.0', '4.0.3 and up']\n",
"['Google Ads', 'BUSINESS', '4.3', '29313', '20M', '5,000,000+', 'Free', '0', 'Everyone', 'Business', 'July 30, 2018', '1.12.0', '4.0.3 and up']\n",
"['Google Ads', 'BUSINESS', '4.3', '29331', '20M', '5,000,000+', 'Free', '0', 'Everyone', 'Business', 'July 30, 2018', '1.12.0', '4.0.3 and up']\n",
"Number of duplicates: 1181\n"
]
}
],
"source": [
"duplicate_apps = []\n",
"unique_apps = []\n",
"\n",
"for app in android:\n",
" name = app[0]\n",
" if name in unique_apps:\n",
" duplicate_apps.append(name)\n",
" else: unique_apps.append(name)\n",
"\n",
"for name in duplicate_apps[5:8]:\n",
" for row in android:\n",
" if name == row[0]:\n",
" print(row)\n",
" \n",
"print(f'Number of duplicates: {len(duplicate_apps)}')"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"9659\n"
]
}
],
"source": [
"reviews_max = {}\n",
"\n",
"for app in android:\n",
" name = app[0]\n",
" n_reviews = float(app[3])\n",
" \n",
" if name in reviews_max and reviews_max[name] < n_reviews:\n",
" reviews_max[name] = n_reviews\n",
" elif name not in reviews_max:\n",
" reviews_max[name] = n_reviews\n",
" \n",
"print(len(reviews_max))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"there are 9659 unique apps and we are now going to remove duplicates based on looking at the row with the highest review count."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[['Paper flowers instructions', 'ART_AND_DESIGN', '4.4', '167', '5.6M', '50,000+', 'Free', '0', 'Everyone', 'Art & Design', 'March 26, 2017', '1.0', '2.3 and up'], ['Smoke Effect Photo Maker - Smoke Editor', 'ART_AND_DESIGN', '3.8', '178', '19M', '50,000+', 'Free', '0', 'Everyone', 'Art & Design', 'April 26, 2018', '1.1', '4.0.3 and up']]\n"
]
}
],
"source": [
"android_clean = []\n",
"already_added = []\n",
"\n",
"for app in android:\n",
" name = app[0]\n",
" n_reviews = float(app[3])\n",
" \n",
" if (n_reviews == reviews_max[name]) and name not in already_added:\n",
" android_clean.append(app)\n",
" already_added.append(name)\n",
" \n",
"print(android_clean[4:6])"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['Pick Your Part Garage', 'AUTO_AND_VEHICLES', '3.9', '142', '32M', '50,000+', 'Free', '0', 'Everyone', 'Auto & Vehicles', 'July 24, 2018', '1.1.5.0', '6.0 and up']\n",
"\n",
"\n",
"['PakWheels: Buy & Sell Cars', 'AUTO_AND_VEHICLES', '4.4', '15168', '37M', '1,000,000+', 'Free', '0', 'Everyone', 'Auto & Vehicles', 'July 27, 2018', '10.0.2', '4.2 and up']\n",
"\n",
"\n",
"['Supervision service', 'AUTO_AND_VEHICLES', '4.0', '2155', '15M', '500,000+', 'Free', '0', 'Everyone', 'Auto & Vehicles', 'July 30, 2018', '1.10.3', '5.0 and up']\n",
"\n",
"\n",
"['Speed Camera Detector - Traffic & Speed Alert', 'AUTO_AND_VEHICLES', '4.3', '138', '5.4M', '100,000+', 'Free', '0', 'Everyone', 'Auto & Vehicles', 'July 23, 2018', '1.0', '4.0.3 and up']\n",
"\n",
"\n",
"['Used car search Goo net whole car Go to net', 'AUTO_AND_VEHICLES', '3.7', '5414', '18M', '1,000,000+', 'Free', '0', 'Everyone', 'Auto & Vehicles', 'July 23, 2018', '3.20.1', '4.4 and up']\n",
"\n",
"\n",
"['CarMax – Cars for Sale: Search Used Car Inventory', 'AUTO_AND_VEHICLES', '4.4', '21777', 'Varies with device', '1,000,000+', 'Free', '0', 'Everyone', 'Auto & Vehicles', 'August 4, 2018', 'Varies with device', 'Varies with device']\n",
"\n",
"\n",
"['BEST CAR SOUNDS', 'AUTO_AND_VEHICLES', '4.3', '348', '38M', '100,000+', 'Free', '0', 'Everyone', 'Auto & Vehicles', 'July 29, 2018', '1.0.3', '2.3 and up']\n",
"\n",
"\n",
"['RST - Sale of cars on the PCT', 'AUTO_AND_VEHICLES', '3.2', '250', '1.1M', '100,000+', 'Free', '0', 'Everyone', 'Auto & Vehicles', 'April 27, 2018', '1.4', '4.0.3 and up']\n",
"\n",
"\n",
"['AutoScout24 Switzerland – Find your new car', 'AUTO_AND_VEHICLES', '4.6', '13372', 'Varies with device', '1,000,000+', 'Free', '0', 'Everyone', 'Auto & Vehicles', 'August 3, 2018', 'Varies with device', 'Varies with device']\n",
"\n",
"\n",
"['Zona Azul Digital Fácil SP CET - OFFICIAL São Paulo', 'AUTO_AND_VEHICLES', '4.6', '7880', 'Varies with device', '100,000+', 'Free', '0', 'Everyone', 'Auto & Vehicles', 'May 10, 2018', '4.6.5', 'Varies with device']\n",
"\n",
"\n"
]
}
],
"source": [
"explore_data(android,80, 90)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"True\n",
"False\n",
"True\n",
"True\n"
]
}
],
"source": [
"def english_chars(name):\n",
" bad_char_count = 0\n",
" for char in name:\n",
" if ord(char) > 127:\n",
" bad_char_count += 1\n",
" \n",
" if bad_char_count > 3:\n",
" return False\n",
" \n",
" return True\n",
" \n",
"test_list = ['Instagram', '爱奇艺PPS -《欢乐颂2》电视剧热播', 'Docs To Go™ Free Office Suite', 'Instachat 😜']\n",
"\n",
"for name in test_list:\n",
" print(english_chars(name))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Flame - درب عقلك يوميا\n",
"သိင်္ Astrology - Min Thein Kha BayDin\n",
"РИА Новости\n",
"صور حرف H\n",
"L.POINT - 엘포인트 [ 포인트, 멤버십, 적립, 사용, 모바일 카드, 쿠폰, 롯데]\n",
"RMEduS - 음성인식을 활용한 R 프로그래밍 실습 시스템\n",
"AJ렌터카 법인 카셰어링\n",
"Al Quran Free - القرآن (Islam)\n",
"中国語 AQリスニング\n",
"日本AV历史\n",
"Ay Yıldız Duvar Kağıtları\n",
"বাংলা টিভি প্রো BD Bangla TV\n",
"Cъновник BG\n",
"CSCS BG (в български)\n",
"뽕티비 - 개인방송, 인터넷방송, BJ방송\n",
"BL 女性向け恋愛ゲーム◆俺プリクロス\n",
"SecondSecret ‐「恋を読む」BLノベルゲーム‐\n",
"BL 女性向け恋愛ゲーム◆ごくメン\n",
"あなカレ【BL】無料ゲーム\n",
"감성학원 BL 첫사랑\n",
"BQ-መጽሐፍ ቅዱሳዊ ጥያቄዎች\n",
"BS Calendar / Patro / पात्रो\n",
"Vip视频免费看-BT磁力搜索\n",
"Билеты ПДД CD 2019 PRO\n",
"Offline Jízdní řády CG Transit\n",
"Bonjour 2017 Abidjan CI ❤❤❤❤❤\n",
"CK 初一 十五\n",
"الفاتحون Conquerors\n",
"DG ग्राम / Digital Gram Panchayat\n",
"DM הפקות\n",
"DW فارسی By dw-arab.com\n",
"لعبة تقدر تربح DZ\n",
"বাংলাflix\n",
"RPG ブレイジング ソウルズ アクセレイト\n",
"英漢字典 EC Dictionary\n",
"ECナビ×シュフー\n",
"أحداث وحقائق | خبر عاجل في اخبار العالم\n",
"EG SIM CARD (EGSIMCARD, 이지심카드)\n",
"パーリーゲイツ公式通販|EJ STYLE(イージェイスタイル)\n",
"FAHREDDİN er-RÂZİ TEFSİRİ\n",
"I'm Rich/Eu sou Rico/أنا غني/我很有錢\n",
"AÖF Ev İdaresi 1. Sınıf\n",
"Ey Sey Storytime រឿងនិទានតាឥសី\n",
"哈哈姆特不EY\n",
"FP Разбитый дисплей\n"
]
}
],
"source": [
"english_android = []\n",
"non_english_android = []\n",
"\n",
"for app in android_clean:\n",
" name = app[0]\n",
" \n",
" if english_chars(name):\n",
" english_android.append(app)\n",
" else:\n",
" non_english_android.append(app)\n",
" \n",
"for app in non_english_android:\n",
" print(app[0])"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"8864\n"
]
}
],
"source": [
"free_eng_android = []\n",
"\n",
"for app in english_android:\n",
" price = app[7]\n",
" \n",
" if price == '0':\n",
" free_eng_android.append(app)\n",
" \n",
"print(len(free_eng_android))"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"def freq_table(dataset, index):\n",
" table = {}\n",
" total = 0\n",
" \n",
" for row in dataset:\n",
" total += 1\n",
" value = row[index]\n",
" if value in table:\n",
" table[value] += 1\n",
" else:\n",
" table[value] = 1\n",
" \n",
" table_percentages = {}\n",
" for key in table:\n",
" percentage = (table[key] / total) * 100\n",
" table_percentages[key] = percentage \n",
" \n",
" return table_percentages\n",
"\n",
"\n",
"def display_table(dataset, index):\n",
" table = freq_table(dataset, index)\n",
" table_display = []\n",
" for key in table:\n",
" key_val_as_tuple = (table[key], key)\n",
" table_display.append(key_val_as_tuple)\n",
" \n",
" table_sorted = sorted(table_display, reverse = True)\n",
" for entry in table_sorted:\n",
" print(entry[1], ':', entry[0])"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"FAMILY : 18.907942238267147\n",
"GAME : 9.724729241877256\n",
"TOOLS : 8.461191335740072\n",
"BUSINESS : 4.591606498194946\n",
"LIFESTYLE : 3.9034296028880866\n",
"PRODUCTIVITY : 3.892148014440433\n",
"FINANCE : 3.7003610108303246\n",
"MEDICAL : 3.531137184115524\n",
"SPORTS : 3.395758122743682\n",
"PERSONALIZATION : 3.3167870036101084\n",
"COMMUNICATION : 3.2378158844765346\n",
"HEALTH_AND_FITNESS : 3.0798736462093865\n",
"PHOTOGRAPHY : 2.944494584837545\n",
"NEWS_AND_MAGAZINES : 2.7978339350180503\n",
"SOCIAL : 2.6624548736462095\n",
"TRAVEL_AND_LOCAL : 2.33528880866426\n",
"SHOPPING : 2.2450361010830324\n",
"BOOKS_AND_REFERENCE : 2.1435018050541514\n",
"DATING : 1.861462093862816\n",
"VIDEO_PLAYERS : 1.7937725631768955\n",
"MAPS_AND_NAVIGATION : 1.3989169675090252\n",
"FOOD_AND_DRINK : 1.2409747292418771\n",
"EDUCATION : 1.1620036101083033\n",
"ENTERTAINMENT : 0.9589350180505415\n",
"LIBRARIES_AND_DEMO : 0.9363718411552346\n",
"AUTO_AND_VEHICLES : 0.9250902527075812\n",
"HOUSE_AND_HOME : 0.8235559566787004\n",
"WEATHER : 0.8009927797833934\n",
"EVENTS : 0.7107400722021661\n",
"PARENTING : 0.6543321299638989\n",
"ART_AND_DESIGN : 0.6430505415162455\n",
"COMICS : 0.6204873646209386\n",
"BEAUTY : 0.5979241877256317\n"
]
}
],
"source": [
"display_table(free_eng_android, 1) # By Category"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1,000,000+ : 15.726534296028879\n",
"100,000+ : 11.552346570397113\n",
"10,000,000+ : 10.548285198555957\n",
"10,000+ : 10.198555956678701\n",
"1,000+ : 8.393501805054152\n",
"100+ : 6.915613718411552\n",
"5,000,000+ : 6.825361010830325\n",
"500,000+ : 5.561823104693141\n",
"50,000+ : 4.7721119133574\n",
"5,000+ : 4.512635379061372\n",
"10+ : 3.5424187725631766\n",
"500+ : 3.2490974729241873\n",
"50,000,000+ : 2.3014440433213\n",
"100,000,000+ : 2.1322202166064983\n",
"50+ : 1.917870036101083\n",
"5+ : 0.78971119133574\n",
"1+ : 0.5076714801444043\n",
"500,000,000+ : 0.2707581227436823\n",
"1,000,000,000+ : 0.22563176895306858\n",
"0+ : 0.04512635379061372\n",
"0 : 0.01128158844765343\n"
]
}
],
"source": [
"display_table(free_eng_android, 5) # By Installs"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ART_AND_DESIGN : 1986335.0877192982\n",
"AUTO_AND_VEHICLES : 647317.8170731707\n",
"BEAUTY : 513151.88679245283\n",
"BOOKS_AND_REFERENCE : 8767811.894736841\n",
"BUSINESS : 1712290.1474201474\n",
"COMICS : 817657.2727272727\n",
"COMMUNICATION : 38456119.167247385\n",
"DATING : 854028.8303030303\n",
"EDUCATION : 1833495.145631068\n",
"ENTERTAINMENT : 11640705.88235294\n",
"EVENTS : 253542.22222222222\n",
"FINANCE : 1387692.475609756\n",
"FOOD_AND_DRINK : 1924897.7363636363\n",
"HEALTH_AND_FITNESS : 4188821.9853479853\n",
"HOUSE_AND_HOME : 1331540.5616438356\n",
"LIBRARIES_AND_DEMO : 638503.734939759\n",
"LIFESTYLE : 1437816.2687861272\n",
"GAME : 15588015.603248259\n",
"FAMILY : 3695641.8198090694\n",
"MEDICAL : 120550.61980830671\n",
"SOCIAL : 23253652.127118643\n",
"SHOPPING : 7036877.311557789\n",
"PHOTOGRAPHY : 17840110.40229885\n",
"SPORTS : 3638640.1428571427\n",
"TRAVEL_AND_LOCAL : 13984077.710144928\n",
"TOOLS : 10801391.298666667\n",
"PERSONALIZATION : 5201482.6122448975\n",
"PRODUCTIVITY : 16787331.344927534\n",
"PARENTING : 542603.6206896552\n",
"WEATHER : 5074486.197183099\n",
"VIDEO_PLAYERS : 24727872.452830188\n",
"NEWS_AND_MAGAZINES : 9549178.467741935\n",
"MAPS_AND_NAVIGATION : 4056941.7741935486\n",
"\n",
"\n",
"\n",
"Best category: COMMUNICATION\n",
"Average Installs: 38456119.167247385\n"
]
}
],
"source": [
"categories_android = freq_table(free_eng_android, 1)\n",
"best_category = ''\n",
"best_avg_install_rate = 0\n",
"\n",
"for category in categories_android:\n",
" total = 0\n",
" len_category = 0\n",
" for app in free_eng_android:\n",
" category_app = app[1]\n",
" if category_app == category: \n",
" n_installs = app[5]\n",
" n_installs = n_installs.replace(',', '')\n",
" n_installs = n_installs.replace('+', '')\n",
" total += float(n_installs)\n",
" len_category += 1\n",
" \n",
" avg_n_installs = total / len_category\n",
" \n",
" if avg_n_installs > best_avg_install_rate:\n",
" best_category = category\n",
" best_avg_install_rate = avg_n_installs\n",
" \n",
" print(category, ':', avg_n_installs)\n",
"\n",
"print('\\n\\n')\n",
"print(f'Best category: {best_category}\\nAverage Installs: {best_avg_install_rate}')"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"WhatsApp Messenger : 1,000,000,000+\n",
"imo beta free calls and text : 100,000,000+\n",
"Android Messages : 100,000,000+\n",
"Google Duo - High Quality Video Calls : 500,000,000+\n",
"Messenger – Text and Video Chat for Free : 1,000,000,000+\n",
"imo free video calls and chat : 500,000,000+\n",
"Skype - free IM & video calls : 1,000,000,000+\n",
"Who : 100,000,000+\n",
"GO SMS Pro - Messenger, Free Themes, Emoji : 100,000,000+\n",
"LINE: Free Calls & Messages : 500,000,000+\n",
"Google Chrome: Fast & Secure : 1,000,000,000+\n",
"Firefox Browser fast & private : 100,000,000+\n",
"UC Browser - Fast Download Private & Secure : 500,000,000+\n",
"Gmail : 1,000,000,000+\n",
"Hangouts : 1,000,000,000+\n",
"Messenger Lite: Free Calls & Messages : 100,000,000+\n",
"Kik : 100,000,000+\n",
"KakaoTalk: Free Calls & Text : 100,000,000+\n",
"Opera Mini - fast web browser : 100,000,000+\n",
"Opera Browser: Fast and Secure : 100,000,000+\n",
"Telegram : 100,000,000+\n",
"Truecaller: Caller ID, SMS spam blocking & Dialer : 100,000,000+\n",
"UC Browser Mini -Tiny Fast Private & Secure : 100,000,000+\n",
"Viber Messenger : 500,000,000+\n",
"WeChat : 100,000,000+\n",
"Yahoo Mail – Stay Organized : 100,000,000+\n",
"BBM - Free Calls & Messages : 100,000,000+\n"
]
}
],
"source": [
"for app in free_eng_android:\n",
" if app[1] == 'COMMUNICATION' and (app[5] == '1,000,000,000+'\n",
" or app[5] == '500,000,000+'\n",
" or app[5] == '100,000,000+'):\n",
" print(app[0], ':', app[5])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"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.8.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment