I can't differentiate non-english from english apps

Screen Link:

My Code: <!–android_english =
ios_english =

for app in android_clean:
name = app[0]
if is_english(name):
android_english.append(app)

for app in ios:
name = app[1]
if is_english(name):
ios_english.append(app)

explore_data(android_english, 0, 3, True)
print(’\n’)
explore_data(ios_english, 0, 3, True)–>

android_english = []
ios_english = []

for app in android_clean:
    if is_english(name):android_english.append(app)
        
for app in ios:
    if is_english(name):ios_english.append(app)
        
explore_data(android_english,0,3,True)
print('\n')
explore_data(ios_english,0,3,True)

What I expected to happen: I was supposed to get Number of android rows to be 9614 and that of ios 6183

What actually happened: i got number of android 9660 and ios 7197. it was like all apps are in english.

['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: 9660
Number of column:s 13


['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 column:s 16

This would depend on multiple factors -

  • What changes you made before you performed the above steps
  • Whether or not you are using the correct datasets (the ones you modified). For example, in you code above, the datasets are android_clean and ios. Are those the datasets that have been modified as per all the instructions so far? If you have missed a previous instruction or you made a mistake somewhere, then the output from the above code could vary as well.
  • An issue with the implementation of your is_english() function.

It’s better to share your code so far (using like a Github link perhaps), or if everything else before this point is correct as per the instructions, then it just might be your is_english() function which might have some problem, and you can consider sharing just that function. But please make sure you format the code here properly and not just paste it as text. It’s easier to read the former.

They do link the Solution Notebook in the instructions, so you can refer to that and cross-check where you might have gone wrong.

thanks for your response @the_doctor.

The code was fine up to that point. here is my is_english function which works fine

def is_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(is_english(‘Docs To Go™ Free Office Suite’))
print(is_english(‘Instachat :stuck_out_tongue_winking_eye:’))
print(is_english(‘Instagram’))
print(is_english(‘爱奇艺PPS -《欢乐颂2》电视剧热播’))

I tried your code in my implementation and I get the correct number of rows for android and ios. So, it does seem it’s related to something else in your code.

I would recommend checking my previously suggested points again -

  • If you are using the correct datasets or not for this part of the instructions. That is, check their variable names as I pointed out above.
  • Go through the Solution Notebook and cross-check your work so far.

Wow, will work on it and touch base with you. Your help is well appreciated