that is not the issue. i have copy and pasted my code. please advise
The Number Of Users Who Use Your App
Project Description: Anaylsis on the number of users who use your app
Project Goal: what type of apps are likely to attract more users on Google Play and the App Store.
opened_file = open(‘AppleStore.csv’)
opened_file2 = open(‘googleplaystore.csv’)
from csv import reader
read_file = reader(opened_file)
read_file2 = reader(opened_file2)
app_data_A = list(read_file)
app_data_G = list(read_file2)
def explore_data(dataset, start, end, rows_and_columns=False):
dataset_slice = dataset[start:end]
for row in dataset_slice:
print(row)
print(’\n’) # adds a new (empty) line after each row
if rows_and_columns:
print(‘Number of rows:’, len(dataset))
print(‘Number of columns:’, len(dataset[0]))
explore_data(app_data_A, 0, 3, False)
[‘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’]
[‘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’]
explore_data(app_data_A, 0, 3, True)
[‘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’]
[‘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’]
Number of rows: 7198
Number of columns: 16
explore_data(app_data_G, 0, 3, True)
[‘App’, ‘Category’, ‘Rating’, ‘Reviews’, ‘Size’, ‘Installs’, ‘Type’, ‘Price’, ‘Content Rating’, ‘Genres’, ‘Last Updated’, ‘Current Ver’, ‘Android Ver’]
[‘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’]
Number of rows: 10842
Number of columns: 13
for row in app_data_G [1:] :
print(row[10472])
IndexErrorTraceback (most recent call last)
in ()
1 for row in app_data_G [1:] :
----> 2 print(row[10472])
IndexError: list index out of range
len(app_data_G)
print(app_data_G[10472])
print(app_data_G[10473])
del app_data_G[10473]
len(app_data_G)
After reviewing few lines of data in the Google Store list, we discovered there were multiple entries of a single app. Some Examples are below
duplicate_apps =
unique_apps =
for app in app_data_G:
name = app[0]
if name in unique_apps:
duplicate_apps.append(name)
else:
unique_apps.append(name)
print(‘Number of duplicate apps:’, len(duplicate_apps))
print(’\n’)
print(‘Examples of duplicate apps:’, duplicate_apps[:5])
Number of duplicate apps: 1181
Examples of duplicate apps: [‘Quick PDF Scanner + OCR FREE’, ‘Box’, ‘Google My Business’, ‘ZOOM Cloud Meetings’, ‘join.me - Simple Meetings’]
I do not want to remove the duplicates. Instead, I will only leave behind the apps with the highest number of reviews because they represent the latest number of users.
reviews_max = {}
for app in app_data_G [1:] :
name = app [0]
n_reviews = float(app[3])
if name in reviews_max and reviews_max[name] < n_reviews :
reviews_max[name] += 1
if name not in reviews_max :
reviews_max[name] = 1
print(‘Length of reviews max dictonary:’, len(reviews_max))
ValueErrorTraceback (most recent call last)
in ()
3 for app in app_data_G [1:] :
4 name = app [0]
----> 5 n_reviews = float(app[3])
6 if name in reviews_max and reviews_max[name] < n_reviews :
7 reviews_max[name] += 1
ValueError: could not convert string to float: ‘3.0M’
andriod_clean =
already_added =
for app in app_data_G [1:]:
name = app[0]
n_reviews = float(app[3])
if (reviews_max[name] == n_reviews) and (name not in already_added) :
andriod_clean.append(app)
already_added.append (name)
print (andriod_clean[:3])
explore_data(andriod_clean, 0, 3,True)
def english (string):
non_ascii = 0
for character in string :
if ord(character) > 127 :
non_ascii += 1
if non_ascii > 3 :
return False
else:
return True
print (english (‘Instagram’))
print( english(‘爱奇艺PPS -《欢乐颂2》电视剧热播’) )
print ( english (‘Docs To Go™ Free Office Suite’))
print (english (‘Instachat
’))
english_google =
english_apple =
for app in andriod_clean :
name = app [0]
if english (name) :
english_google.append(app)
for app in app_data_A :
name = app [1]
if english (name):
english_apple.append(app)
explore_data (english_google, 0, 3, True)
print (’\n’)
explore_data (english_apple, 0, 3, True)