Title: my app
Intro: Our aim it to help our developers understand what type of apps are likely to attract more users on Google Play and the App Store. We'll need to to collect and analyze data about mobile apps available on Google Play and the App Store.
from csv import reader
opened_file = open('AppleStore.csv')
read_file = reader(opened_file)
applestore = list(read_file)
apple = applestore[1:]
appleheader = applestore[0]
print(appleheader)
opened_file = open('googleplaystore.csv')
read_file = reader(opened_file)
googleplay = list(read_file)
google = googleplay[1:]
googleheader = googleplay[0]
print(googleheader)
def explore_data(dataset, start, end, rows_and_columns=False):
dataset_slice = dataset[start:end]
for row in dataset_slice:
print(row)
print('\n')
if rows_and_columns:
print(('number of rows:'), len(dataset))
print(('number of columns:'), len(dataset[0]))
['id', 'track_name', 'size_bytes', 'currency', 'price', 'rating_count_tot', 'rating_count_ver', 'user_rating', 'user_rating_ver', 'ver', 'cont_rating', 'prime_genre', 'sup_devices.num', 'ipadSc_urls.num', 'lang.num', 'vpp_lic'] ['App', 'Category', 'Rating', 'Reviews', 'Size', 'Installs', 'Type', 'Price', 'Content Rating', 'Genres', 'Last Updated', 'Current Ver', 'Android Ver']
explore_data(apple, 0, 3,rows_and_columns=True)
explore_data(google, 0, 3, rows_and_columns=True)
['284882215', 'Facebook', '389879808', 'USD', '0.0', '2974676', '212', '3.5', '3.5', '95.0', '4+', 'Social Networking', '37', '1', '29', '1'] ['389801252', 'Instagram', '113954816', 'USD', '0.0', '2161558', '1289', '4.5', '4.0', '10.23', '12+', 'Photo & Video', '37', '0', '29', '1'] ['529479190', 'Clash of Clans', '116476928', 'USD', '0.0', '2130805', '579', '4.5', '4.5', '9.24.12', '9+', 'Games', '38', '5', '18', '1'] number of rows: 7197 number of columns: 16 ['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'] ['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'] ['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'] number of rows: 10841 number of columns: 13
print(google[10472])
['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']
for row in google:
if len(row) != len(googleplay[0]):
print(row)
print(google.index(row))
['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'] 10472
del google[10472]
duplicategoogleapp=[]
uniquegoogleapp=[]
for row in google:
appname=row[0]
if appname in uniquegoogleapp:
duplicategoogleapp.append(appname)
else:
uniquegoogleapp.append(appname)
print(duplicategoogleapp[1:5])
['Box', 'Google My Business', 'ZOOM Cloud Meetings', 'join.me - Simple Meetings']
print(len(duplicategoogleapp))
1181
We don't want to count certain apps more than once when we analyze data, so we need to remove the duplicate entries and keep only one entry per app.
From the rows we printed for the Instagram app, the main difference happens on the fourth position of each row, which corresponds to the number of reviews. The different numbers show the data was collected at different times. Rather than removing duplicates randomly, we'll only keep the row with the highest number of reviews and remove the other entries for any given app.
reviews_max={}
for row in google:
name = row[0]
n_reviews = float(row[3])
if name in reviews_max and reviews_max[name] < n_reviews:
reviews_max[name] = n_reviews
if name not in reviews_max:
reviews_max[name] = n_reviews
print(len(reviews_max))
9659
print('Expected length:', len(google) - 1181)
Expected length: 9659
android_clean=[]
already_added=[]
for row in google:
name = row[0]
n_reviews = float(row[3])
if n_reviews == reviews_max[name] and (name not in already_added):
android_clean.append(row)
already_added.append(name)
print(len(android_clean))
9659
def check_english(string):
for character in string:
if ord(character) > 127:
return False
return True
print(check_english('Instagram'))
print(check_english('爱奇艺PPS -《欢乐颂2》电视剧热播'
))
print(check_english('Docs To Go™ Free Office Suite'
))
print(check_english('Instachat 😜'))
True False False False
def checking_english(string):
nonen = 0
for character in string:
if ord(character) > 127:
nonen += 1
if nonen > 3:
return False
else:
return True
print(checking_english('Instagram'))
print(checking_english('爱奇艺PPS -《欢乐颂2》电视剧热播'
))
print(checking_english('Docs To Go™ Free Office Suite'
))
print(checking_english('Instachat 😜'))
True False True True
google_en=[]
apple_en=[]
for app in android_clean:
name = app[0]
if checking_english(name):
google_en.append(app)
for app in apple:
name = app[1]
if checking_english(name):
apple_en.append(app)
print(explore_data(google_en, 0, 3, rows_and_columns=True))
print('\n')
print(explore_data(apple_en, 0, 3, rows_and_columns=True))
['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'] ['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'] ['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'] number of rows: 9614 number of columns: 13 None ['284882215', 'Facebook', '389879808', 'USD', '0.0', '2974676', '212', '3.5', '3.5', '95.0', '4+', 'Social Networking', '37', '1', '29', '1'] ['389801252', 'Instagram', '113954816', 'USD', '0.0', '2161558', '1289', '4.5', '4.0', '10.23', '12+', 'Photo & Video', '37', '0', '29', '1'] ['529479190', 'Clash of Clans', '116476928', 'USD', '0.0', '2130805', '579', '4.5', '4.5', '9.24.12', '9+', 'Games', '38', '5', '18', '1'] number of rows: 6183 number of columns: 16 None
free_google_en=[]
free_apple_en=[]
for app in google_en:
price = app[7]
if price == '0':
free_google_en.append(app)
for app in apple_en:
price = app[4]
if price == '0.0':
free_apple_en.append(app)
print(len(free_google_en))
print(len(free_apple_en))
8864 3222
Our validation strategy for an app idea is comprised of three steps:
Because our end goal is to add the app on both Google Play and the App Store, we need to find app profiles that are successful on both markets.
def freq_table(dataset, index):
freq_dic = {}
number = 0
for row in dataset:
key = row[index]
number +=1
if key in freq_dic:
freq_dic[key] += 1
else:
freq_dic[key] = 1
percentage={}
for key in freq_dic:
percentage [key] = (freq_dic[key] / number) * 100
return percentage
def display_table(dataset, index):
table = freq_table(dataset, index)
table_display = []
for key in table:
key_val_as_tuple = (table[key], key)
table_display.append(key_val_as_tuple)
table_sorted = sorted(table_display, reverse = True)
for entry in table_sorted:
print(entry[1], ':', entry[0])
display_table(free_apple_en , -5)
Games : 58.16263190564867 Entertainment : 7.883302296710118 Photo & Video : 4.9658597144630665 Education : 3.662321539416512 Social Networking : 3.2898820608317814 Shopping : 2.60707635009311 Utilities : 2.5139664804469275 Sports : 2.1415270018621975 Music : 2.0484171322160147 Health & Fitness : 2.0173805090006205 Productivity : 1.7380509000620732 Lifestyle : 1.5828677839851024 News : 1.3345747982619491 Travel : 1.2414649286157666 Finance : 1.1173184357541899 Weather : 0.8690254500310366 Food & Drink : 0.8069522036002483 Reference : 0.5586592178770949 Business : 0.5276225946617008 Book : 0.4345127250155183 Navigation : 0.186219739292365 Medical : 0.186219739292365 Catalogs : 0.12414649286157665
Games is the most common genre, and Entertainment the runner-up. The top genres are for fun.Most of the apps in appstore are designed for entertainment.
display_table(free_google_en, 1)
FAMILY : 18.907942238267147 GAME : 9.724729241877256 TOOLS : 8.461191335740072 BUSINESS : 4.591606498194946 LIFESTYLE : 3.9034296028880866 PRODUCTIVITY : 3.892148014440433 FINANCE : 3.7003610108303246 MEDICAL : 3.531137184115524 SPORTS : 3.395758122743682 PERSONALIZATION : 3.3167870036101084 COMMUNICATION : 3.2378158844765346 HEALTH_AND_FITNESS : 3.0798736462093865 PHOTOGRAPHY : 2.944494584837545 NEWS_AND_MAGAZINES : 2.7978339350180503 SOCIAL : 2.6624548736462095 TRAVEL_AND_LOCAL : 2.33528880866426 SHOPPING : 2.2450361010830324 BOOKS_AND_REFERENCE : 2.1435018050541514 DATING : 1.861462093862816 VIDEO_PLAYERS : 1.7937725631768955 MAPS_AND_NAVIGATION : 1.3989169675090252 FOOD_AND_DRINK : 1.2409747292418771 EDUCATION : 1.1620036101083033 ENTERTAINMENT : 0.9589350180505415 LIBRARIES_AND_DEMO : 0.9363718411552346 AUTO_AND_VEHICLES : 0.9250902527075812 HOUSE_AND_HOME : 0.8235559566787004 WEATHER : 0.8009927797833934 EVENTS : 0.7107400722021661 PARENTING : 0.6543321299638989 ART_AND_DESIGN : 0.6430505415162455 COMICS : 0.6204873646209386 BEAUTY : 0.5979241877256317
display_table(free_google_en, -4)
Tools : 8.449909747292418 Entertainment : 6.069494584837545 Education : 5.347472924187725 Business : 4.591606498194946 Productivity : 3.892148014440433 Lifestyle : 3.892148014440433 Finance : 3.7003610108303246 Medical : 3.531137184115524 Sports : 3.463447653429603 Personalization : 3.3167870036101084 Communication : 3.2378158844765346 Action : 3.1024368231046933 Health & Fitness : 3.0798736462093865 Photography : 2.944494584837545 News & Magazines : 2.7978339350180503 Social : 2.6624548736462095 Travel & Local : 2.3240072202166067 Shopping : 2.2450361010830324 Books & Reference : 2.1435018050541514 Simulation : 2.0419675090252705 Dating : 1.861462093862816 Arcade : 1.8501805054151623 Video Players & Editors : 1.7712093862815883 Casual : 1.7599277978339352 Maps & Navigation : 1.3989169675090252 Food & Drink : 1.2409747292418771 Puzzle : 1.128158844765343 Racing : 0.9927797833935018 Role Playing : 0.9363718411552346 Libraries & Demo : 0.9363718411552346 Auto & Vehicles : 0.9250902527075812 Strategy : 0.9138086642599278 House & Home : 0.8235559566787004 Weather : 0.8009927797833934 Events : 0.7107400722021661 Adventure : 0.6768953068592057 Comics : 0.6092057761732852 Beauty : 0.5979241877256317 Art & Design : 0.5979241877256317 Parenting : 0.4963898916967509 Card : 0.45126353790613716 Casino : 0.42870036101083037 Trivia : 0.41741877256317694 Educational;Education : 0.39485559566787 Board : 0.3835740072202166 Educational : 0.3722924187725632 Education;Education : 0.33844765342960287 Word : 0.2594765342960289 Casual;Pretend Play : 0.236913357400722 Music : 0.2030685920577617 Racing;Action & Adventure : 0.16922382671480143 Puzzle;Brain Games : 0.16922382671480143 Entertainment;Music & Video : 0.16922382671480143 Casual;Brain Games : 0.13537906137184114 Casual;Action & Adventure : 0.13537906137184114 Arcade;Action & Adventure : 0.12409747292418773 Action;Action & Adventure : 0.10153429602888085 Educational;Pretend Play : 0.09025270758122744 Simulation;Action & Adventure : 0.078971119133574 Parenting;Education : 0.078971119133574 Entertainment;Brain Games : 0.078971119133574 Board;Brain Games : 0.078971119133574 Parenting;Music & Video : 0.06768953068592057 Educational;Brain Games : 0.06768953068592057 Casual;Creativity : 0.06768953068592057 Art & Design;Creativity : 0.06768953068592057 Education;Pretend Play : 0.056407942238267145 Role Playing;Pretend Play : 0.04512635379061372 Education;Creativity : 0.04512635379061372 Role Playing;Action & Adventure : 0.033844765342960284 Puzzle;Action & Adventure : 0.033844765342960284 Entertainment;Creativity : 0.033844765342960284 Entertainment;Action & Adventure : 0.033844765342960284 Educational;Creativity : 0.033844765342960284 Educational;Action & Adventure : 0.033844765342960284 Education;Music & Video : 0.033844765342960284 Education;Brain Games : 0.033844765342960284 Education;Action & Adventure : 0.033844765342960284 Adventure;Action & Adventure : 0.033844765342960284 Video Players & Editors;Music & Video : 0.02256317689530686 Sports;Action & Adventure : 0.02256317689530686 Simulation;Pretend Play : 0.02256317689530686 Puzzle;Creativity : 0.02256317689530686 Music;Music & Video : 0.02256317689530686 Entertainment;Pretend Play : 0.02256317689530686 Casual;Education : 0.02256317689530686 Board;Action & Adventure : 0.02256317689530686 Video Players & Editors;Creativity : 0.01128158844765343 Trivia;Education : 0.01128158844765343 Travel & Local;Action & Adventure : 0.01128158844765343 Tools;Education : 0.01128158844765343 Strategy;Education : 0.01128158844765343 Strategy;Creativity : 0.01128158844765343 Strategy;Action & Adventure : 0.01128158844765343 Simulation;Education : 0.01128158844765343 Role Playing;Brain Games : 0.01128158844765343 Racing;Pretend Play : 0.01128158844765343 Puzzle;Education : 0.01128158844765343 Parenting;Brain Games : 0.01128158844765343 Music & Audio;Music & Video : 0.01128158844765343 Lifestyle;Pretend Play : 0.01128158844765343 Lifestyle;Education : 0.01128158844765343 Health & Fitness;Education : 0.01128158844765343 Health & Fitness;Action & Adventure : 0.01128158844765343 Entertainment;Education : 0.01128158844765343 Communication;Creativity : 0.01128158844765343 Comics;Creativity : 0.01128158844765343 Casual;Music & Video : 0.01128158844765343 Card;Action & Adventure : 0.01128158844765343 Books & Reference;Education : 0.01128158844765343 Art & Design;Pretend Play : 0.01128158844765343 Art & Design;Action & Adventure : 0.01128158844765343 Arcade;Pretend Play : 0.01128158844765343 Adventure;Education : 0.01128158844765343
unique_apple_genre = freq_table(free_apple_en , -5)
for genre in unique_apple_genre:
total = 0
len_genre = 0
for app in free_apple_en:
genre_app = app[-5]
if genre_app == genre:
total += float(app[5])
len_genre += 1
average_n_rating = total / len_genre
print(genre, "," , average_n_rating)
Navigation , 86090.33333333333 Games , 22788.6696905016 Book , 39758.5 Health & Fitness , 23298.015384615384 Entertainment , 14029.830708661417 Reference , 74942.11111111111 Travel , 28243.8 Medical , 612.0 Finance , 31467.944444444445 News , 21248.023255813954 Catalogs , 4004.0 Food & Drink , 33333.92307692308 Music , 57326.530303030304 Weather , 52279.892857142855 Lifestyle , 16485.764705882353 Business , 7491.117647058823 Sports , 23008.898550724636 Social Networking , 71548.34905660378 Utilities , 18684.456790123455 Education , 7003.983050847458 Photo & Video , 28441.54375 Shopping , 26919.690476190477 Productivity , 21028.410714285714
unique_google_category = freq_table(free_google_en , 1)
for category in unique_google_category:
total = 0
len_category = 0
for app in free_google_en:
category_app = app[1]
if category_app == category:
n_installs = app[5]
n_installs = n_installs.replace('+', '')
n_installs = n_installs.replace(',', '')
total += float(n_installs)
len_category += 1
average_n_installs = total / len_category
print(category, "," , average_n_installs)
AUTO_AND_VEHICLES , 647317.8170731707 HEALTH_AND_FITNESS , 4188821.9853479853 LIBRARIES_AND_DEMO , 638503.734939759 FINANCE , 1387692.475609756 PRODUCTIVITY , 16787331.344927534 SOCIAL , 23253652.127118643 PERSONALIZATION , 5201482.6122448975 HOUSE_AND_HOME , 1331540.5616438356 FAMILY , 3695641.8198090694 ENTERTAINMENT , 11640705.88235294 EDUCATION , 1833495.145631068 PARENTING , 542603.6206896552 BOOKS_AND_REFERENCE , 8767811.894736841 BUSINESS , 1712290.1474201474 LIFESTYLE , 1437816.2687861272 DATING , 854028.8303030303 PHOTOGRAPHY , 17840110.40229885 COMICS , 817657.2727272727 BEAUTY , 513151.88679245283 TOOLS , 10801391.298666667 MEDICAL , 120550.61980830671 NEWS_AND_MAGAZINES , 9549178.467741935 SHOPPING , 7036877.311557789 EVENTS , 253542.22222222222 ART_AND_DESIGN , 1986335.0877192982 MAPS_AND_NAVIGATION , 4056941.7741935486 VIDEO_PLAYERS , 24727872.452830188 COMMUNICATION , 38456119.167247385 SPORTS , 3638640.1428571427 WEATHER , 5074486.197183099 TRAVEL_AND_LOCAL , 13984077.710144928 GAME , 15588015.603248259 FOOD_AND_DRINK , 1924897.7363636363